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 20, 2024
1 parent 5d8451a commit 8fa8596
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 @@ -4313,7 +4313,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 8fa8596

Please sign in to comment.