-
Notifications
You must be signed in to change notification settings - Fork 18
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
wait: no child processes #2
Comments
@diocles that would be an issue for your use case as the reaper could potentially "harvest" the process (depending on the scheduler) before Since the code here is waiting for the process group ID matching the parent (the process where this code runs), So try something like:
Otherwise you'd probably need some other custom code to do the bookkeeping (in lieu of this library) - aka keep track of all the processes started and wait only on those. HTH |
@diocles closing this out - please reopen if it is still an issue. |
@ramr sorry for my slow response to this. I think the "-1" in the Wait4 call you linked to means "clean any child process". Even if this constant were 0, I'm not sure that setting the process group id is enough to stop the child process getting cleaned up. I can't see a way forward yet, though. Here's a test for the issue:
And here's the output:
EDIT: I'm not sure this is a bug in go-reaper, though, so I'm not intending to reopen the issue unless there's something to fix. |
@diocles sorry my bad - I forgot the pid is the first argument and was set to PTAL and see if that fixes your problem/helps you out. If you use the |
When trying go-reaper in a service at work, we're getting this error:
This looks quite similar to this issue on gitlab-ci-multi-runner:
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/989
Our code calls cmd.Run(), so I think what's happening is that the process is getting cleaned up by the reaper before cmd.Wait() can reach it, but I need to debug it further.
The text was updated successfully, but these errors were encountered: