-
Notifications
You must be signed in to change notification settings - Fork 553
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
Container status wrt reboots and hooks #958
Comments
Your question about rebooting is already covered by the lifecycle and specifically, step 7. A reboot causes the container process to exit, but the
These are correct in the most obvious cases, but the spec allows runtimes to add additional states which could also be returned.
I'm not sure about this one, but from memory this is something that some folks from @opencontainers/runtime-tools-maintainers have been working on ironing out. As far as I can tell, |
How would there be a deleted state...when...it's...deleted? |
On a reboot, it would be gone because the state is kept in |
On Mon, Mar 12, 2018 at 09:25:59AM -0700, Alban Crequy wrote:
- poststop: since the hook is called after the container is deleted,
the state is not "stopped" anymore but maybe some fantoom
"deleted" state?
I'm fine with ‘stopped’ here, because the spec definition still
applies [1]. I'm also fine adding a new ‘deleted’ state to cover this
situtation.
Either way, the only consumers who should see this state are the
post-stop hooks. After the core of ‘delete’ completes (before the
post-stop hooks start firing), external folks calling ‘state’ on the
container may be getting “container not found” errors for that
container ID. Although it may be worth tightening up the “does not
exist” language in [2] to clarify that point.
[1]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/runtime.md#L22
[2]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/runtime.md#L92
|
This makes sense (for runc), but so does @cyphar's argument for |
I'm just a newcomer, but basically I agree with @alban. Currently it's a little confusing. At the moment the spec defines an action So if we add |
On Wed, Apr 04, 2018 at 01:49:10PM +0000, Dongsu Park wrote:
So if we add `deleted` status that is distinguished from `stopped`,
we would also want to add `Stop` action…
We don't need a `Stop` action. We already have kill [1], and if you
use this to send TERM or KILL (which API implementations MUST support
[2]) you can force the container process to exit (which is the
‘stopped’ state [3]).
[1]: https://github.com/opencontainers/runtime-spec/blob/v1.0.1/runtime.md#kill
[2]: https://github.com/opencontainers/runtime-tools/blob/v0.5.0/docs/command-line-interface.md#kill
[3]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/runtime.md#L22
|
The spec defines 4 statuses:
What's happening when a container is created and then the machine is rebooted? Should the container be deleted, or should it be in the "stopped" state?
The spec also defines hooks and each hook receives the state of the container from stdin. What should be the status of the container in each hook?
Could the spec clarify those two points?
The text was updated successfully, but these errors were encountered: