jasonrbriggs / stomp.py

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ or RabbitMQ) using the STOMP protocol (versions 1.0, 1.1 and 1.2). It can also be run as a standalone, command-line client for testing.
Apache License 2.0
495 stars 166 forks source link

Network disconnect while waiting for receipt blocks forever #310

Open adwood opened 4 years ago

adwood commented 4 years ago

Testing v4.1.23 but code is the same in v6.0.0. When using WaitingListener.wait_on_receipt(), if the network connection breaks while waiting, the self.receipt_condition.wait() call blocks forever.

One solution is to add a timeout parameter to the method so the wait() does not stall forever.

A better solution might be to have WaitingListener.on_disconnected() check whether self.received is False and notify() and raise an exception.