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

RSDK-9591 - Add Kill to ManagedProcess #399

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cheukt
Copy link
Member

@cheukt cheukt commented Dec 27, 2024

This is part one of two PRs that will hopefully help with shutting down all module processes before viam-server exits. Part 2 is here

This is still a draft as I'm looking for thoughts and ideas around making this better.

The idea behind this is for a Kill() call to propagate from the viam-server, and we should not block on anything if possible. The kill()s here do not wait for the execed process to complete, and this is intentional - I couldn't find if syscall.Kill waits for completion, so did not use. I wasn't able to find documentation about whether kill -9 blocks on the signal getting received or if it immediately returns, so opted for .Start() instead of .Run(), which means we do not Wait() for the process to return. This does mean that the assumption is that the viam-server ends immediately after and that the system will properly await the processes that we spawned to kill the managed process, otherwise those processes will be zombie'd. I can see changing it so that we do a .Run() instead, but might mean we would have to do the module process killing in parallel in viam-server.

There is a todo to add Kill to the processManager, but a quick glance at how Close works for processManager makes me think that it should be a followup task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Mark as safe to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants