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

fix(socketio/client): connect timeout panic under heavy traffic #252

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

Totodore
Copy link
Owner

Motivation

Under heavy traffic, some desynchronisation between events might happen and then lead to panic with the connect timeout mechanism.
If a ns connect message is received, we stop the connect timeout task. But if the connect timeout task has been triggerred in the meantime the Receiver is dropped and the Sender will panic because we unwrap the send error tx.send(()).unwrap();.

Solution

Discard the error like that tx.send(()).ok();

@Totodore Totodore added bug Something isn't working socketio-v5 It is only about the version 5 of the socket.io protocol labels Jan 24, 2024
@Totodore Totodore enabled auto-merge (squash) January 24, 2024 10:50
@Totodore Totodore merged commit d8af2b2 into main Jan 24, 2024
12 checks passed
@Totodore Totodore deleted the fix-panic-connect-timeout branch January 24, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working socketio-v5 It is only about the version 5 of the socket.io protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant