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

runtime: move prestart hook in lifecycle section #1167

Closed

Conversation

corhere
Copy link
Contributor

@corhere corhere commented Oct 31, 2022

config.md specifies that "prestart hooks MUST be called after the start operation is called but before the user-specified program command is executed." However, the Lifecycle section in runtime.md contradicts this by showing that prestart hooks are called after the create operation is called and before the start operation. As the note in the config.md section for createRuntime hooks indicates, the order of operations in runtime.md#Lifecycle reflects the old runC behaviour which was contrary to the spec. Update the Lifecycle section to be congruent with the hook semantics as specified in config.md.

Signed-off-by: Cory Snider csnider@mirantis.com

config.md specifies that "`prestart` hooks MUST be called after the
`start` operation is called but before the user-specified program
command is executed." However, the Lifecycle section in runtime.md
contradicts this by showing that `prestart` hooks are called after the
`create` operation is called and before the `start` operation. As the
note in the config.md section for `createRuntime` hooks indicates, the
order of operations in runtime.md#Lifecycle reflects the old runC
behaviour which was contrary to the spec. Update the Lifecycle section
to be congruent with the hook semantics as specified in config.md.

Signed-off-by: Cory Snider <csnider@mirantis.com>
@h-vetinari
Copy link
Contributor

It was my understanding from that despite being wrong, the prestart hooks could not be fixed (both in spec and implementation), because doing so would have broken a lot of projects relying on the old behaviour, hence why they were deprecated and replaced.

I think their placement in the lifecycle reflects that reality, and changing it is not really desirable.

I may be misremembering things from the sheer infinite #1008, but just my 2¢.

@AkihiroSuda
Copy link
Member

The actual behavior of runc can't be changed practically, so let's merge #1169

@corhere corhere deleted the prestart-before-startcontainer branch December 28, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants