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

Work around channel overflow for freshly created subscriptions #184

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

pborzenkov
Copy link
Contributor

When a new subscription is created, the data is sent directly to the
broadcast channel. If this channel overflows because the receiver is
not fast enough, the error is not detected by select! and the client
is left hanging forever.

Fix the error detection, so that the client can actually re-subscribe.
Since it re-subscribes with existing subscription, the initial data
is sent to the mpsc channel that doesn't suffer from the overflow
issue.

When a new subscription is created, the data is sent directly to the
broadcast channel. If this channel overflows because the receiver is
not fast enough, the error is not detected by `select!` and the client
is left hanging forever.

Fix the error detection, so that the client can actually re-subscribe.
Since it re-subscribes with existing subscription, the initial data
is sent to the mpsc channel that doesn't suffer from the overflow
issue.
@jeromegn jeromegn merged commit 357863a into main Apr 11, 2024
3 of 4 checks passed
@jeromegn jeromegn deleted the fix-fresh-sub branch April 11, 2024 19:05
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.

2 participants