-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
perf: Subscriber performance #578
Conversation
Review-related changes
# Conflicts: # caddy/go.mod
Thank you very, very much @kevburnsjr! |
Humm, it looks like we may have a data race @kevburnsjr: https://github.com/dunglas/mercure/runs/4192750294?check_suite_focus=true |
} | ||
|
||
// Disconnect disconnects the subscriber. | ||
func (s *Subscriber) Disconnect() { | ||
s.disconnectedOnce.Do(func() { | ||
close(s.disconnected) | ||
close(s.out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change creates a deadlock. https://github.com/dunglas/mercure/pull/578/files#diff-802f9d2c1e1a0efff7a8474036a024fbbba988f5bdf4650a0b3b4dad99df9ca2R74 can be called after this, and blocks forever.
Significantly improves memory usage and throughput with large number of subscribers.