File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
9393 defer cancel ()
9494
9595 if status := <- ctr .Wait (subCtx , containertypes .WaitConditionNotRunning ); status .Err () == nil {
96+ // Ensure container status changes are committed by handler of container exit before returning control to the caller
97+ ctr .Lock ()
98+ defer ctr .Unlock ()
9699 // container did exit, so ignore any previous errors and return
97100 return nil
98101 }
@@ -122,5 +125,9 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
122125 // container did exit, so ignore previous errors and continue
123126 }
124127
128+ // Ensure container status changes are committed by handler of container exit before returning control to the caller
129+ ctr .Lock ()
130+ defer ctr .Unlock ()
131+
125132 return nil
126133}
You can’t perform that action at this time.
0 commit comments