Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
cluster: Don't lock the scheduler when removing a container.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Luzzardi <[email protected]>
  • Loading branch information
aluzzardi committed Oct 9, 2015
1 parent 91279c8 commit 2439461
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cluster/swarm/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,9 @@ func (c *Cluster) createContainer(config *cluster.ContainerConfig, name string,
return container, err
}

// RemoveContainer aka Remove a container from the cluster. Containers should
// always be destroyed through the scheduler to guarantee atomicity.
// RemoveContainer aka Remove a container from the cluster.
func (c *Cluster) RemoveContainer(container *cluster.Container, force, volumes bool) error {
c.scheduler.Lock()
defer c.scheduler.Unlock()

err := container.Engine.RemoveContainer(container, force, volumes)
return err
return container.Engine.RemoveContainer(container, force, volumes)
}

func (c *Cluster) getEngineByAddr(addr string) *cluster.Engine {
Expand Down

0 comments on commit 2439461

Please sign in to comment.