-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
When StopContainer is called, the container will be forcibly terminated with the SIGKILL signal, which cannot be caught or handled by processes. This immediately kills processes without prior warning, which may result in data loss for some types of workloads (such as databases) or other undesirable behaviour (such as connection timeouts, as applications don't have a chance to gracefully close connections).
Code reference: https://github.com/kubernetes-incubator/cri-o/blob/master/oci/oci.go#L278
List of available signals: https://en.wikipedia.org/wiki/Unix_signal#POSIX_signals
We should consider a more graceful shutdown sequence, such as:
- Send process
SIGTERM - Wait up to 60 seconds for the process to die
- Log an warning ("process did not stop after ...") and issue a
SIGKILLto forcibly kill the process
I think Docker Engine currently does something like this, so we can use that behaviour as inspiration.
Metadata
Metadata
Assignees
Labels
No labels