bugfix: optimize shim lock in runtime v1 avoid dead lock#2743
bugfix: optimize shim lock in runtime v1 avoid dead lock#2743crosbymichael merged 1 commit intocontainerd:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2743 +/- ##
=======================================
Coverage 43.74% 43.74%
=======================================
Files 100 100
Lines 10728 10728
=======================================
Hits 4693 4693
Misses 5305 5305
Partials 730 730
Continue to review full report at Codecov.
|
runtime/v1/shim/service.go
Outdated
There was a problem hiding this comment.
init is only used by moby I guess.
There was a problem hiding this comment.
You could do this as an empty string, however I think it might just make sense to have another function with a different signature, like getInitProcess()
There was a problem hiding this comment.
"init" string is I want to distinguish s.id and r.ID, consider that r.ID also can be empty. I agree
with to make getInitProcess() to do this, since this is also my first considered plan. It not make confused with init.
apply lock only around process map of shim service, avoid lock affect other procs operations. Signed-off-by: Ace-Tang <aceapril@126.com>
|
Just curious, have you run benchmark on this, does it leads to some time improvement? |
|
@mlaventure , when multiple exec runs, it will cause dead lock, the detail I describe at top and in issue #2709. benchmark not done. |
|
LGTM |
[release/1.1] cherry-pick: optimize shim lock in runtime v1
origin issue is containerd#2709, detail dead lock information is in containerd#2743. This is long time issue, I wonder if the patch this can fix instead of workaround it Signed-off-by: Ace-Tang <aceapril@126.com>
apply lock only around process map of shim service, avoid lock affect
other procs operations.
Signed-off-by: Ace-Tang aceapril@126.com
should also fix #2739 .