-
Notifications
You must be signed in to change notification settings - Fork 888
fix: Leaking yamux session after HTTP handler is closed #326
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
Conversation
Closes #317. We depended on the context canceling the yamux connection, but this isn't a sync operation. Explicitly calling close ensures the handler waits for yamux to complete before exit.
coderd/provisionerdaemons.go
Outdated
defer func() { | ||
_ = session.Close() | ||
}() |
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.
Awesome! Nice find @kylecarbs 🎉 This looks like it should fix some of those goleak
s that are picked up after the test runs.
Codecov Report
@@ Coverage Diff @@
## main #326 +/- ##
=======================================
Coverage 63.61% 63.61%
=======================================
Files 69 69
Lines 786 786
Branches 77 77
=======================================
Hits 500 500
Misses 271 271
Partials 15 15
Continue to review full report at Codecov.
|
Still happened after this change. I believe I understand why though, and am working on a fix: https://github.com/coder/coder/runs/5251190813?check_suite_focus=true#step:7:45 |
ca2202d
to
eaf3a37
Compare
Closes #317. We depended on the context canceling the yamux connection,
but this isn't a sync operation. Explicitly calling close ensures the
handler waits for yamux to complete before exit.