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

SpreadWriter: fix flush panic with zero writes #1441

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

ploxiln
Copy link
Member

@ploxiln ploxiln commented Feb 28, 2023

fixes #1435

Because the only user of this is nsqd/statsd.go, we could just return without sleeping in this case, and the statsd loop has its own ticker to wait on. But I figured, we might as well make SpreadWriter.flush() always take the desired amount of time, it might be less confusing if this is ever reused, and it's not hard.

(Another interesting idea is to just add a zero-byte buf to the list of bufs if it is empty, but that does result in a zero-byte write syscall, which you can detect with netcat ... it's probably fine, but it's a bit weird.)

@mreiferson mreiferson added the bug label Mar 6, 2023
@mreiferson mreiferson merged commit 1362af1 into nsqio:master Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nsqd: panic when statsd enabled and memstats disabled with no topics
2 participants