Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly mark connection as broken on SSL error and don't crash loop_forever #797

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

PierreF
Copy link
Contributor

@PierreF PierreF commented Jan 7, 2024

Catch all OSError as indicator of connection broken. It should especially include SSL error. Also make WebsocketConnectionError a subclass of ConnectionError (which is a subclass of OSError).

Should fix #750.

@gdt
Copy link

gdt commented Jan 10, 2024

I've been running this a few days including a few netflakes and my client is connected. I can't prove it is right but I lean to merging it.

@PierreF PierreF force-pushed the catch-ssl-error branch 2 times, most recently from 223804c to f0e63d2 Compare January 13, 2024 17:15
@PierreF
Copy link
Contributor Author

PierreF commented Jan 13, 2024

I've made a revert on Websocket wrapper connection due to issue catched during additional tests (f0e63d2).

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
@PierreF PierreF merged commit 869cce2 into master Jan 20, 2024
17 of 21 checks passed
@PierreF PierreF deleted the catch-ssl-error branch January 20, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSL EOF leads to persistent non-delivery of messages
2 participants