-
Notifications
You must be signed in to change notification settings - Fork 18.6k
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Unique event for automatic container restarts would be useful #9214
Comments
I'm hoping that #8662 will add some information wrt the exit code of a container's PID1 |
#dibs |
Let me extend @slaupster's table to cover a process exiting of its own volition where the restart policy doesn't apply:
For my purposes, it would be nicer to get some notification of 'restart' or 'autorestart' before the 'die' event. I am tracking some extra information about containers, and have to retain it beyond a 'die' event to see if a 'start' comes later. |
See #11827 which introduces an |
Thanks for the pointer, but I can't see that the proposed As mentioned there, adding information to the |
@bboreham Having a unique event for automatic restart doesn't change this either. You still have to wait for the event when the container is restarted. |
Maybe if I said it another way: I am asking for something like:
where the "start is coming!" is either an extra event or extra data on the Knowing about a restart policy (and interpreting the |
@bboreham The state information for a container already provides this information. |
OK, thanks for pointing that out. So this issue should be closed then? |
We can wait until the exit event is merged (and it should close this automatically when merged). |
As far as I can see, State.Restarting only covers the "abend" case, not the restart-by-command case. |
@bboreham But there is an event for restart by command already. |
I know. The one thing I was trying to add to this issue is that I, in my code, want to know a restart is pending at or before the time the |
@bboreham But how can we know that it is going to be restarted before the |
When Docker is controlling both the stop and the start because it is actioning a |
#dibs |
@thaJeztah I think you can close this seems that it has been added ? |
Currently there is no unique event for when a container is automatically restarted by the daemon. Such an event can be determined from the sequence of events for a container:
Trick is to simply track "die, start" sequences and check for at some later time the absence or presence of a restart event for the container in question (ugly). A unique event would be nice, eg:
Use case is that docker does a nice job of hiding containers that abend by just restarting them. It would be nice to trap that event to get an idea that it is happening.
Discussed here on forum:
https://forums.docker.com/t/docker-events-when-container-automatically-restarted/356
The text was updated successfully, but these errors were encountered: