-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix(common.socket): Switch to context to simplify closing #15589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran my reproducer for the issue with this branch for over 40k metrics and confirmed that the new pprof captures look better than before.
One inline comment about checking an error, otherwise I would like to land and get this in for our bug fix release next Monday.
Thanks!
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
(cherry picked from commit 3d9562b)
Summary
Switching the socket-close implementation to context cancellation avoids the complexity to keep track of all open connection. As side effects, this PR avoids the memory leak described in #15509 and avoids race conditions when closing the socket while new connections arrive.
Checklist
Related issues
resolves #15509