File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
7474 defer func () {
7575 if retErr == nil {
7676 daemon .LogContainerEvent (ctr , events .ActionStop )
77+ // Ensure container status changes are committed by handler of container exit before returning control to the caller
78+ ctr .Lock ()
79+ defer ctr .Unlock ()
7780 }
7881 }()
7982
@@ -93,9 +96,6 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
9396 defer cancel ()
9497
9598 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 ()
9999 // container did exit, so ignore any previous errors and return
100100 return nil
101101 }
@@ -125,9 +125,5 @@ func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Containe
125125 // container did exit, so ignore previous errors and continue
126126 }
127127
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-
132128 return nil
133129}
You can’t perform that action at this time.
0 commit comments