moby/libcontainerd
Cory Snider c12bbf549b
libcontainerd/supervisor: fix data race
The monitorDaemon() goroutine calls startContainerd() then blocks on
<-daemonWaitCh to wait for it to exit. The startContainerd() function
would (re)initialize the daemonWaitCh so a restarted containerd could be
waited on. This implementation was race-free because startContainerd()
would synchronously initialize the daemonWaitCh before returning. When
the call to start the managed containerd process was moved into the
waiter goroutine, the code to initialize the daemonWaitCh struct field
was also moved into the goroutine. This introduced a race condition.

Move the daemonWaitCh initialization to guarantee that it happens before
the startContainerd() call returns.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit dd20bf4862)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-02-03 11:40:54 +01:00
..
local libcontainerd: create unstarted tasks 2024-01-10 13:50:26 -05:00
queue bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
remote libcontainerd: create unstarted tasks 2024-01-10 13:50:26 -05:00
shimopts daemon: allow shimv2 runtimes to be configured 2023-02-17 18:08:06 -05:00
supervisor libcontainerd/supervisor: fix data race 2024-02-03 11:40:54 +01:00
types libcontainerd: create unstarted tasks 2024-01-10 13:50:26 -05:00
libcontainerd_linux.go Configure shims from runtime config 2020-07-13 14:18:02 -07:00
libcontainerd_windows.go Remove unused useShimV2() 2020-07-15 14:28:48 +02:00
replace.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00