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

Add WaitGroup to ensure consumer has sent all before removing itself #850

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

spuun
Copy link
Member

@spuun spuun commented Nov 16, 2024

WHAT is this pull request doing?

I'm not sure we've run into this potential bug, but this is a solution to make sure the consumer has written all to socket before it's removing itself from a queue. The bug may trigger if it's the last consumer because then the queue will unmap its segments, but the consumer may still have references to a mapped segment that it tries to write to socket, resulting in a crash.

HOW can this pull request be tested?

Uhm... yolo? Should try to add specs for this.

@spuun spuun requested a review from a team as a code owner November 16, 2024 15:13
@viktorerlingsson
Copy link
Member

Does this impact performance?

@spuun
Copy link
Member Author

spuun commented Nov 18, 2024

Does this impact performance?

Can't say it's noticeable. I guess benchmarks are in margin of error. This fix is what's needed for the "flush fiber" I've been playing around with, and that gives a 10-15% increased throughput.

@viktorerlingsson
Copy link
Member

Can't say it's noticeable. I guess benchmarks are in margin of error. This fix is what's needed for the "flush fiber" I've been playing around with, and that gives a 10-15% increased throughput.

Okay, nice! 👍

@spuun spuun force-pushed the dont-remove-consumer-to-early branch from f326bd1 to 9b44a23 Compare November 20, 2024 10:26
@spuun spuun force-pushed the dont-remove-consumer-to-early branch from 9b44a23 to bb26f7d Compare November 20, 2024 11:53
@spuun spuun merged commit ed9ddcd into main Nov 20, 2024
9 of 18 checks passed
@spuun spuun deleted the dont-remove-consumer-to-early branch November 20, 2024 11:53
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.

3 participants