Use ContainerWait() before starting container#31794
Use ContainerWait() before starting container#31794jlhawn wants to merge 1 commit intomoby:masterfrom
Conversation
`docker run` can block indefinitely waiting for a 'die' event that never comes. While this doesn't happen when connected directly to the Docker engine running the container, it does occur often when getting events from a swarm-classic aggregate event stream. Using the `ContainerWait()` API call is more reliable in this case. Docker-DCO-1.1-Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
eb9bad8 to
3859a4b
Compare
|
Note that we had been using the |
|
ping @tonistiigi @mlaventure PTAL |
|
Actually, I don't think this works the way I expect ... Apparently the This conflicts with the comment on that function which says:
|
|
How does this handle the |
The intention is to not use events at all, but just wait for the container to exit. The client will know (depending on the API version being used) whether it is responsible for deleting the container when |
|
@jlhawn But if client is not responsible for deleting the container it needs to wait until daemon has cleaned it up. Otherwise, things like |
|
oh I see, so the |
|
I did push for semantics changes for |
docker runcan block indefinitely waiting for a 'die' event that never comes.While this doesn't happen when connected directly to the Docker engine running
the container, it does occur often when getting events from a swarm-classic
aggregate event stream.
Using the
ContainerWait()API call is more reliable in this case.