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

Prevent lavinmq from freezing when closing consumers and channels #947

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

spuun
Copy link
Member

@spuun spuun commented Feb 13, 2025

WHAT is this pull request doing?

When closing a connection with tons of consumers lavinmq will freeze because the fiber closing the connection will be CPU bound for a very long time.

This PR adds yields to the loops closing consumers and channels.

HOW can this pull request be tested?

Start lavinmq then run lavinmqperf connection-count -x 1 -c 10000 -C 1. Close perf and observe that e.g. mgmt ui is responsive while lavinmq is closing the connection.

@spuun spuun requested a review from a team as a code owner February 13, 2025 08:36
Copy link
Member

@viktorerlingsson viktorerlingsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spuun spuun merged commit 99a8f27 into main Feb 13, 2025
23 of 25 checks passed
@spuun spuun deleted the yield-when-closing-connections branch February 13, 2025 09:08
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