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

nsqd: panic when statsd enabled and memstats disabled with no topics #1435

Closed
carl-reverb opened this issue Jan 10, 2023 · 1 comment · Fixed by #1441
Closed

nsqd: panic when statsd enabled and memstats disabled with no topics #1435

carl-reverb opened this issue Jan 10, 2023 · 1 comment · Fixed by #1441
Labels

Comments

@carl-reverb
Copy link

https://github.com/nsqio/nsq/blob/master/internal/writers/spread_writer.go#L32

If a nsqd instance is configured to publish statsd metrics without memory stats (defaults to true) and there are no topics on the instance, the length of the buffer at flush interval will be zero, resulting in a divide by zero error.

Workaround by publishing memory stats, or creating a topic.

@mreiferson mreiferson added the bug label Feb 11, 2023
@mreiferson mreiferson changed the title NSQd with statsd, no mem stats, no topics, panics divide by zero nsqd: panic when statsd enabled and memstats disabled with no topics Feb 11, 2023
@mreiferson
Copy link
Member

good catch, interested in submitting a PR to fix?

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 a pull request may close this issue.

2 participants