Skip to content

Commit

Permalink
Don't break Websocket connection on BlockingIO & like error
Browse files Browse the repository at this point in the history
Previous commit catcher wider exception in WebsocketWrapper (OSError),
which include temporary error like BlockingIOError, SSLWantReadError...
This caused Websocket connection to break and cause client reconnection
when it should only cause a later retry.
Revert to catching previous ConnectionError, which should be fine, other
fatal error like SSLEOFError that might happen would still be catched
by caller (_sock_recv) which will take care of closing the websocket connection
  • Loading branch information
PierreF committed Jan 13, 2024
1 parent c170387 commit 223804c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4296,7 +4296,7 @@ def _recv_impl(self, length: int) -> bytes:
else:
raise BlockingIOError

except OSError:
except ConnectionError:
self.connected = False
return b''

Expand Down

0 comments on commit 223804c

Please sign in to comment.