fix: goroutine leak in TestRingLogger#51854
Conversation
|
Thank you for contributing! It appears your commit message is missing a DCO sign-off, We require all commit messages to have a There is no need to open a new pull request, but to fix this (and make CI pass), Unfortunately, it's not possible to do so through GitHub's web UI, so this needs You can find some instructions in the output of the DCO check (which can be found Steps to do so "roughly" come down to:
Sorry for the hassle (I wish GitHub would make this a bit easier to do), and let me know if you need help or more detailed instructions! |
Use ring.Close() instead of ring.setClosed() to properly broadcast to waiting goroutines and prevent goroutine leak. Fixes moby#49717 Signed-off-by: Vedant Madane <[email protected]>
365a64a to
bead7d7
Compare
Summary
Fixes a goroutine leak in TestRingLogger by using
ing.Close() instead of
ing.setClosed().
Details
ing.setClosed() only sets the close flag but doesn't:
.buffer.Close() which would broadcast to waiting goroutines
This leaves the goroutine started by
ewRingLogger waiting forever on cond.Wait().
ing.Close() properly broadcasts to wake up waiting goroutines and waits for them to complete.
Test plan
Fixes #49717