eclipse / paho.mqtt.python

paho.mqtt.python
Other
2.17k stars 723 forks source link

Upgrade ConnectionError to OSError #674

Closed enkiusz closed 7 months ago

enkiusz commented 2 years ago

Upgrade ConnectionError to OSError to catch more TCP failures (for example timeouts). Minor exception handling cleanups.

gonzalocasas commented 1 year ago

+1 to this because ConnectionError is causing the client to be unusable in Python 2.7.

PierreF commented 8 months ago

Hello and thanks for your patience.

I'm not sure what issue we want to solve. It seems we should never get any TimeoutError since the socket is set to setblocking(0). So I guess we receive BlockingIOError instead of a possible TimeoutError ?

In case of Timeout, shouldn't we prefer the handling done in BlockingIOError: retry later rather that disconnect ?

PierreF commented 7 months ago

Closing this PR, since #797 which fixed another issue (SSL error not being catched) seems to result in very similar fixed.

If there is some case not covered by #797 feel free to re-open the PR and explaining what issue you solve this your PR.