mirror of https://github.com/docker/compose.git
fix(convergence): Serialize access to observed state
Signed-off-by: Ananta Dwi Prasetya Purna Yuda <hi@anantadwi13.com>
This commit is contained in:
parent
41df35c1f4
commit
bdb8545611
|
@ -223,7 +223,7 @@ func (c *convergence) stopDependentContainers(ctx context.Context, project *type
|
|||
// Stop dependent containers, so they will be restarted after service is re-created
|
||||
dependents := project.GetDependentsForService(service)
|
||||
for _, name := range dependents {
|
||||
dependents := c.observedState[name]
|
||||
dependents := c.getObservedState(name)
|
||||
err := c.service.stopContainers(ctx, w, dependents, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -232,7 +232,7 @@ func (c *convergence) stopDependentContainers(ctx context.Context, project *type
|
|||
dependent.State = ContainerExited
|
||||
dependents[i] = dependent
|
||||
}
|
||||
c.observedState[name] = dependents
|
||||
c.setObservedState(name, dependents)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue