You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Kim van der Riet <ki...@redhat.com> on 2017/06/02 18:20:45 UTC

Review Request 59755: Python 0-10 messaging driver does not handle heartbeat timeouts, "assert rcv.received < rcv.impending" occurs

-----------------------------------------------------------
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


Re: Review Request 59755: Python 0-10 messaging driver does not handle heartbeat timeouts, "assert rcv.received < rcv.impending" occurs

Posted by Alan Conway <ac...@redhat.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59755/#review177200
-----------------------------------------------------------


Ship it!




Ship It!

- Alan Conway


On June 2, 2017, 6:20 p.m., Kim van der Riet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59755/
> -----------------------------------------------------------
> 
> (Updated June 2, 2017, 6:20 p.m.)
> 
> 
> 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
> 
>