oci: unconditionally set as not stopping after a stop stops stopping
if we only call SetAsNotStopping on error, then subsequent calls to ContainerStop
will deadlock, causing the stop not to be idempotent
@@ -806,7 +806,6 @@ func (r *runtimeOCI) StopContainer(ctx context.Context, c *Container, timeout in
return nil
}
defer func() {
- if retErr != nil {
// Failed to stop, set stopping to false.
// Otherwise, we won't actually
// attempt to stop when a new request comes in,
@@ -815,7 +814,6 @@ func (r *runtimeOCI) StopContainer(ctx context.Context, c *Container, timeout in
// routines waiting to change the stop timeout to give up.
close(c.stopStoppingChan)
c.SetAsNotStopping()
- }
}()
c.opLock.Lock()
