-
Notifications
You must be signed in to change notification settings - Fork 859
Add a crash-handler.wait-pipe-close
parameter
#1092
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
Add a crash-handler.wait-pipe-close
parameter
#1092
Conversation
If this parameter is set to true, the crash handler will wait until the pipe opened to the crash handler is closed by it. This is useful if the crash handler is ptracing the main process in order to get more information.
Thank you for the PR. Before going into the details, please let me understand the background. I would like to know the reason you are using ptrace from the crash handler. Do you start ptrace-ing when the server process crashes? |
Yes, that's correct, on |
Updated to use |
878a846
to
58076aa
Compare
struct pollfd pfd[1]; | ||
pfd[0].fd = crash_handler_fd; | ||
pfd[0].events = POLLERR | POLLHUP; | ||
poll(pfd, 1, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be wiser to check for EINTR (and call poll again in such case), considering the fact that signals other than the one that is being handled by this signal handler may preempt the execution of poll
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update, sorry for the delay.
Looks fine to me aside from the nitpicking comment.
Done in c30db4e, thanks! |
Add a `crash-handler.wait-pipe-close` parameter
If this parameter is set to true, the crash handler will wait until the
pipe opened to the crash handler is closed by it. This is useful if the
crash handler is ptracing the main process in order to get more
information.