Skip to content

shim logger processes never gets a SIGTERM #4159

@aaithal

Description

@aaithal

Description
Because shim logger processes are created with exec.CommandContext, they never receive the SIGTERM signal when they are killed by the shim process.

This means that the shim logging plugin never gets the chance to clean up before it exits (send buffered logs to destination etc). Having some sort of a mechanism similar to what's listed below would be helpful in a graceful exit of the logging plugin:

  1. SIGTERM is sent to the logger
  2. A wait for the expiration of a grace period happens
  3. The shim logging plugin gets SIGKILL

Steps to reproduce the issue:
Not recording any steps here as it's pretty obvious from the code that there's no grace period being provided to logging plugins to do their cleanup. But, if deemed necessary, a sample plugin binary code can be provided.

Describe the results you received:
The shim logging plugin never receives the SIGTERM signal.

Describe the results you expected:
For SIGTERM to be delivered to the logging plugin.

Output of containerd --version:

$ containerd --version
containerd github.com/containerd/containerd v1.3.0 36cf5b690dcc00ff0f34ff7799209050c3d0c59a

Any other relevant information: N/A

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions