Merge pull request #47300 from corhere/libc8d/fix-startup-data-race

libcontainerd/supervisor: fix data race
This commit is contained in:
Brian Goff 2024-02-01 15:02:00 -08:00 committed by GitHub
commit e240ba44b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -190,12 +190,13 @@ func (r *remote) startContainerd() error {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
err := cmd.Start()
startedCh <- err
if err != nil {
startedCh <- err
return
}
r.daemonWaitCh = make(chan struct{})
startedCh <- nil
// Reap our child when needed
if err := cmd.Wait(); err != nil {
r.logger.WithError(err).Errorf("containerd did not exit successfully")