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
metrics/cgroups: fix deadlock issue in Add during Collect #6788
Conversation
87c0dd6
to
72258cd
Compare
Build succeeded.
|
This doesn't affect v1.5? Or same issue there? |
It was introduced by #5744 and released from 1.6 😃 |
Thanks! (just checking if I didn't have to 🍒⛏ for 1.5 as well |
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.
LGTM
The Collector.Collect will be the field ns'Collect's callback, which be invoked periodically with internal lock. And Collector.Add also runs with ns.Lock in Collector.Lock, which is easy to cause deadlock. Goroutine X: ns.Collect ns.Lock Collector.Collect Collector.RLock Goroutine Y: Collector.Add Collector.Lock ns.Lock We should use ns.Lock without Collector.Lock in Add. Fix: containerd#6772 Signed-off-by: Wei Fu <fuweid89@gmail.com>
Build succeeded.
|
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.
LGTM
Thanks heaps for the quick response to this |
When do you plan to release 1.6.3 with the fix? |
The Collector.Collect will be the field ns'Collect's callback, which be
invoked periodically with internal lock. And Collector.Add also runs
with ns.Lock in Collector.Lock, which is easy to cause deadlock.
Goroutine X:
Goroutine Y:
We should use ns.Lock without Collector.Lock in Add.
Fix: #6772
Signed-off-by: Wei Fu fuweid89@gmail.com