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 unsubscribe during inflight subscribe in goroutine #372

Merged
merged 2 commits into from
May 2, 2024

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Apr 29, 2024

This fixes a case when unsubscribe command received during a subscribe command is being processed in a separate goroutine.

For example, this may be hit when client_concurrency > 1 in Centrifugo.

We now wait for subscribe completion before processing unsubscribe. Not doing this could result in already subscribed error when processing subscribe request in a separate goroutine and sequence like subscribe -> unsubscribe -> subscribe happens quickly.

@FZambia FZambia merged commit 2188a02 into master May 2, 2024
9 checks passed
@FZambia FZambia deleted the fix_unsubscribe_race branch May 2, 2024 05:03
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.

1 participant