eclipse / paho.mqtt.python

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

Exception in mqtt thread after reconnection #851

Closed szymonk211 closed 3 weeks ago

szymonk211 commented 3 weeks ago

Exception in thread paho-mqtt-client-: 2024-06-14T07:08:44.080628233Z Traceback (most recent call last): 2024-06-14T07:08:44.080694538Z File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner 2024-06-14T07:08:44.094547567Z self.run() 2024-06-14T07:08:44.094622812Z File "/usr/lib/python3.10/threading.py", line 953, in run 2024-06-14T07:08:44.095497317Z self._target(*self._args, **self._kwargs) 2024-06-14T07:08:44.095548976Z File "/var/lib/odoo/.local/lib/python3.10/site-packages/paho/mqtt/client.py", line 4523, in _thread_main 2024-06-14T07:08:44.099756872Z self.loop_forever(retry_first_connection=True) 2024-06-14T07:08:44.099840414Z File "/var/lib/odoo/.local/lib/python3.10/site-packages/paho/mqtt/client.py", line 2318, in loop_forever 2024-06-14T07:08:44.101517517Z self._reconnect_wait() 2024-06-14T07:08:44.101577877Z File "/var/lib/odoo/.local/lib/python3.10/site-packages/paho/mqtt/client.py", line 4534, in _reconnect_wait 2024-06-14T07:08:44.104545127Z self._reconnect_delay = min( 2024-06-14T07:08:44.104579453Z TypeError: '<' not supported between instances of 'str' and 'int'

I disonnected from the mqtt broker, after I reconnected I had this bug. It looks like something easy to fix, so I post it here. It is not a big problem for me (not high priority).

szymonk211 commented 3 weeks ago

nvm, I put str inside self._client.reconnect_delay_set, this probably caused the error.