fix a potential deadlock (restartmanager/restartmanager.go)#42576
fix a potential deadlock (restartmanager/restartmanager.go)#42576charlesxsh wants to merge 1 commit intomoby:masterfrom
Conversation
Signed-off-by: Shihao Xia <charlesxsh@hotmail.com>
|
Looks like another flaky libnetwork test; |
|
Can we merge the pull request? The change can fix the potential deadlock, and it seems that it does not have any bad side effects. |
|
Not LGTM
Line 117 and 115 are mutually exclusive. If one case executes, the other doesn't. |
|
@songlh what's driving your interest in this? Is there a concrete edge case this resolves that you're running into? If we had a way to reproduce the deadlock, this would be much more interesting. As it stands, we don't really have enough information here to determine whether this is as critical as you seem to believe it to be, so it would be helpful to get more details. |
|
@tianon this is not critical. The bug is found by our dynamic tool. We just want to know programmers' attitude awards this bug. |
|
This is a bit more tricky to tell what affect this is going to have. I'm hesitant to take this change. |
|
If it's not critical, and we're not 100% sure if there may be side-effects, I'll go ahead and close this one for now. Feel free to continue the discussion though! |
More precise description should be: |
Signed-off-by: Shihao Xia charlesxsh@hotmail.com
- What I did
- How I did it
moby/restartmanager/restartmanager.go
Lines 108 to 125 in d12fc17
If line 117 happened first, and there is no receiver for ch created at line 108, line 115 might be blocked forever.
One example is
moby/restartmanager/restartmanager_test.go
Line 13 in d12fc17
The channel returned is directly been omitted.
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)