eclipse / paho.mqtt.python

paho.mqtt.python
Other
2.19k stars 722 forks source link

Fix wait_for_publish that could hang for QoS=0 message #796

Closed PierreF closed 8 months ago

PierreF commented 9 months ago

If reconnect() is called (which happen on auto-reconnection or on first connection done by loop_forever), any pending QoS = 0 message were dropped without unblocking wait_for_publish().

We now ensure wait_for_publish() is unblocked and raise RuntimeError with MQTT_ERR_CONN_LOST

Fix #549