Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition with "docker-compose run -d" and docker rm #5498

Closed
mehertz opened this issue Dec 20, 2017 · 5 comments
Closed

Race condition with "docker-compose run -d" and docker rm #5498

mehertz opened this issue Dec 20, 2017 · 5 comments
Labels

Comments

@mehertz
Copy link

mehertz commented Dec 20, 2017

Hi,

I'm seeing what appears to be a race condition between docker-compose run and docker rm. I'm attempting to run docker-compose run on a box which has containers (of the same service!) being actively created and removed and i'm seeing intermittent errors when issuing the next docker-compose run. This can be replicated by running the following command twice:

$ for i in {1..14}; do sudo docker rm test_$i; sudo docker-compose run -d --name test_$i test & done; wait
...
test_7
ERROR: No such container: ea639df9e498c681586a3be619a09381d60896e62b068aa0c884c0998585ee9b
test_14
...

I believe this is because even when just doing a run, docker-compose first grabs the list of available containers, and then does docker inspect on each individual container before spinning up the new container. If an docker rm is issued between grabbing the list of containers and inspecting the container, the above error occurs.

I'm not sure what a good solution is for this. Is it possible for me to do docker-compose run without inspecting every container?

Thanks

@shin-
Copy link

shin- commented Dec 20, 2017

Hi!

Yes, unfortunately this is a problem because of the way container naming is done - see #1516
It should be fixed by #5432

@mehertz
Copy link
Author

mehertz commented Dec 21, 2017

Yeh, I thought that would be it. I'm actually manually setting the container name though, so regardless there's no need to be inspecting every container!

@shin- shin- closed this as completed Nov 15, 2018
@shin- shin- reopened this Nov 15, 2018
@pauldraper
Copy link

Unfortunately, #5432 has been closed :/

@stale
Copy link

stale bot commented Oct 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 9, 2019
@stale
Copy link

stale bot commented Oct 16, 2019

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants