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

fix(shutdown): handle termination for container #23

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

radu-matei
Copy link
Member

@radu-matei radu-matei commented Mar 4, 2024

This commit handles incoming termination signal for tasks, ensuring
tasks are correctly terminated.

diff for this change: bf26bdb

ref #22
ref spinkube/spin-operator#40
ref deislabs/containerd-wasm-shims#207

Signed-off-by: Radu Matei [email protected]
Co-authored-by: Rajat Jindal [email protected]

@radu-matei radu-matei changed the title feat(spin/assets): support loading static assets fix(shutdown): handle termination for container Mar 4, 2024
@kate-goldenring
Copy link
Collaborator

@radu-matei does this close/resolve the referenced issues?

This commit handles incoming termination signal for tasks, ensuring
tasks are correctly terminated.

Signed-off-by: Radu Matei <[email protected]>
Co-authored-by: Rajat Jindal <[email protected]>
Copy link
Collaborator

@kate-goldenring kate-goldenring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed that while sudo ctr task kill static --signal 2 used to not work it does with these changes

@radu-matei
Copy link
Member Author

@kate-goldenring this is part of resolving #22 (the other part being in Spin).

Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Added one question for my own understanding

log::error!("ERROR >>> Trigger executor failed: {:?}", err);
Err(err)
}
Err(aborted) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what situations will the spin engine abort?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Mossaka,

My understanding (based on running tests with a k3d based setup) is that when a pod is terminating, it will send the TERM signal to the shim. and because we were not handling the term signal, this will continue to run until a KILL signal is sent after TerminateGracefulSeconds limit is crossed.

Thank you

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.

5 participants