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

client: handle disconnections better #80

Merged
merged 5 commits into from
Dec 18, 2023
Merged

Conversation

andreykaipov
Copy link
Owner

@andreykaipov andreykaipov commented Dec 18, 2023

In cases of highly concurrent clients, there seems to be some bugs when disconnecting and still trying to write to the closed websocket connection or to the internal channels used. These added checks should hopefully prevent most of those panics. 🤞

For some reason this was more prevalent when using gorilla/websocket v1.5.1 instead of v1.5.0 (#64).

Also changes most of the DEBUG logs to TRACE logs.

1. close all the channels upon a disconnection
2. don't try to write to them if we've initiated a disconnection
3. check for ErrCloseSent from gorilla/websocket
@andreykaipov andreykaipov enabled auto-merge (squash) December 18, 2023 06:10
@andreykaipov andreykaipov merged commit c7baaaf into main Dec 18, 2023
4 checks passed
@andreykaipov andreykaipov deleted the feature/client-improvements branch December 18, 2023 06:10
@andreykaipov andreykaipov added bug Something isn't working feature fix and removed feature bug Something isn't working labels Dec 18, 2023
@ddaggHT ddaggHT mentioned this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant