-
Notifications
You must be signed in to change notification settings - Fork 17
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
Consider waitpid
#111
Comments
Wait, are the processes likely to be children of the |
Oops, I didn't read that far, yah in most cases it will actually be the opposite, the process doing the minidump writing is the parent. |
Yeah, my suggestion was because there's only two cases here when using |
It'd be interesting to try and create a test case for that, but I don't have a clue how one could reliably get into such a situation. |
@gabrielesvelto forgive me if I'm missing the detail, but you didn't mention the child relationship in the first case of your comment. As far as I understand, Wrt
But that doesn't guarantee that the Linux implementation meets that requirement. |
Yeah, As @Jake-Shadle said the process writing the minidumps is often a parent of the minidumped processes, but not always. We could leverage this to do the following:
There's another upside to using
I've checked the kernel just in case, it implements this precisely this way. Once |
As mentioned in this PR, we could use
waitpid
first and then fallback to the current implementation of reading the process status from/proc/<pid>/stat
if thewaitpid
fails for some reason. However, we currently have a timeout (defaulting to 100ms) waiting for the state to change, before going ahead with the process dumping, meaning if we wanted to keep a timeout/best effort stopping, we'd need to do something similar to this to be able to timeout the waitpid if it takes too long. In most cases I'd assume the waitpid would succeed/fail quickly and the timeout wouldn't matter, but that's not guaranteed, and the current polling solution, while less efficient, is quite simple.The text was updated successfully, but these errors were encountered: