docker-archive / classicswarm

Swarm Classic: a container clustering system. Not to be confused with Docker Swarm which is at https://github.com/docker/swarmkit
Apache License 2.0
5.75k stars 1.08k forks source link

Delete container race #2797

Closed chris-crone closed 4 years ago

chris-crone commented 7 years ago

There is a race when deleting a container: https://github.com/docker/swarm/blob/master/api/handlers.go#L698-L706

First we try to fetch the container. If it doesn't exist we return a 404 immediately. If it does exist, we try to delete it. If the container has been removed between these two calls, we will get a 500 status code and a different error message.

I would recommend removing the initial check so that the error is at least consistent as we do for volumes.