-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59755/
-----------------------------------------------------------

Review request for qpid and Justin Ross.


Bugs: qpid-7809
    https://issues.apache.org/jira/browse/qpid-7809


Repository: qpid-python


Description
-------

When using the older Qpid Python messaging client (AMQP 0-10), a heartbeat 
timeout event results in the client never reconnecting to the broker. In 
addition, attempts to transfer messages after the heartbeat timeout result in a 
Python exception "assert rcv.received < rcv.impending".

When a heartbeat timeout occurs the qpid.messaging.Driver object closes its 
qpid.messaging.Engine instance and schedules a reconnection. But in order for a 
connection to be made, the _transport object must be set to None. In addition, 
no check is made when qpid.messaging.Driver.readable() is called that the 
engine is not closed, and this allows operations (such as message transfers) to 
be performed on the closed engine. In the case of a message transfer, this 
results in a Python exception assert rcv.received < rcv.impending.
This patch sets both the engine and the transport to None when the engine is 
closed (by calling st_closed(). Additional checks are made at various Driver 
calls that the engine instance is not None to prevent operations occurring 
before a connection is reestablished.


Diffs
-----

  qpid/messaging/driver.py 146b818 


Diff: https://reviews.apache.org/r/59755/diff/1/


Testing
-------

Works when tested against a RHUI test set with heartbeats set to cause frequent 
timeouts


Thanks,

Kim van der Riet

Reply via email to