containerd/runtime
Chen Yiyang 68dd47ef70 containerd-shim-runc-v2: avoid potential deadlock in create handler
After pr #8617, create handler of containerd-shim-runc-v2 will
call handleStarted() to record the init process and handle its exit.
Init process wouldn't quit so early in normal circumstances. But if
this screnario occurs, handleStarted() will call
handleProcessExit(), which will cause deadlock because create() had
acquired s.mu, and handleProcessExit() will try to lock it again.

So, I added a parameter muLocked to handleStarted to indicate whether
or not s.mu is currently locked, and thus deciding whether or not to
lock it when calling handleProcessExit.

Fix: #9103
Signed-off-by: Chen Yiyang <cyyzero@qq.com>
2023-10-02 17:44:41 +00:00
..
opts Use github.com/containerd/cgroups/v3 to remove gogo 2022-11-14 21:07:48 +00:00
restart Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00
v2 containerd-shim-runc-v2: avoid potential deadlock in create handler 2023-10-02 17:44:41 +00:00
events.go Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00
monitor.go Add runtime label to metrics 2021-07-23 10:04:46 -07:00
nsmap.go Use RWMutex in NSMap and reduce lock area 2023-06-14 17:50:54 +00:00
runtime.go go.mod: github.com/containerd/typeurl/v2 v2.1.0 2023-02-11 23:39:52 +09:00
task.go Consolidate gogo/protobuf dependencies under our own protobuf package 2022-04-19 15:53:36 +00:00
typeurl.go go.mod: github.com/containerd/typeurl/v2 v2.1.0 2023-02-11 23:39:52 +09:00