Skip to content

Plugin process children do not get killed #964

Open
@j-lanson

Description

@j-lanson

Plugin processes are std::process:Child objects, the only way to delete them in an OS-agnostic way is the Child::kill() function. Per the docs, this is equivalent to a SIGKILL in Unix, which cannot be caught, and therefore handled. This means that when the immediate child process (the plugin entrypoint) dies, it does not get any opportunity to clean up any of its own children, who therefore persist after the parent has been killed.

For example, using a uv run entrypoint to start a python plugin causes a grandchild python3 process to start. When hipcheck core kills the uv run process, the python3 grandchild sticks around because it received no signal.

It would be preferable to be able to send a less "harsh" signal to the child process so it can respond and exit gracefully, or semantically to say that when the gRPC connection closes, the plugin should shut down. In the meantime, I will probably update the python SDK to track its own parent PID and exit when the parent has been killed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    product: hcRelates to the core "hc" binaryproduct: python-sdkRelates to the Python plugin SDKtype: bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions