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

Closing a Kafka writer hangs #2497

Closed
danxmoran opened this issue Mar 11, 2021 · 1 comment · Fixed by #2498
Closed

Closing a Kafka writer hangs #2497

danxmoran opened this issue Mar 11, 2021 · 1 comment · Fixed by #2498
Assignees

Comments

@danxmoran
Copy link
Contributor

  • Our Kafka writers run a metric-collecting goroutine in the background.
  • The goroutine ranges over a time.Ticker's channel, and calls Done() on a sync.WaitGroup after the range completes.
  • Close() on the writer calls Stop() on the ticker, then Wait() on the wait group
  • Calling Stop() on a ticker doesn't actually close its channel, so:
    • The range over the channel never completes
    • Done() is never called on the wait group
    • Wait() on the wait group never completes
@danxmoran danxmoran self-assigned this Mar 11, 2021
@danxmoran
Copy link
Contributor Author

Note: this can also cause requests to update Kafka configs to hang, because certain config updates call Close() on every existing writer.

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

1 participant