-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fdbmonitor: track parent process death for FreeBSD #8381
Conversation
Result of foundationdb-pr-clang on Linux CentOS 7
|
Doxense CI Report for Windows 10
|
Result of foundationdb-pr-macos on macOS BigSur 11.5.2
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
#ifdef __linux__ | ||
signal(SIGCHLD, SIG_DFL); | ||
#endif | ||
sigprocmask(SIG_SETMASK, mask, nullptr); |
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.
To avoid changing the behavior for MacOS, should this be included in freebsd?
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.
Imho, executing sigprocmask() only under linux is a typo.
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 looks like the goal of this is to restore the original signal mask to the child processes, which in theory could run on all platforms. It does also seem that we don't actually change the signal mask except on Linux, so maybe this doesn't actually need to be run on anything but Linux. If we wanted to do the latter, though, it may be clearer to have this function call sigprocmask
unconditionally and then have the other platforms pass in a null
mask.
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.
@sfc-gh-abeamon, I believe, there's a moment when the signal mask can be changed on non-Linux system. load_conf()
via start_process()
is executed with &normal_mask
on all platforms at
foundationdb/fdbmonitor/fdbmonitor.cpp
Line 1628 in 713fce3
load_conf(confpath.c_str(), uid, gid, &normal_mask, watched_fds, &maxfd); |
Result of foundationdb-pr on Linux CentOS 7
|
What about to commit? @jzhou77 , @sfc-gh-abeamon ? |
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Close because of CI failure and cloned this PR in #11361 |
Track parent process death for FreeBSD.
Before: When dbmonitor terminated, the children continued to work.
After: Children receive a SIGHUP signal and finish their work.
Also fixed sigprocmask() restore.
Code-Reviewer Section
The general pull request guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branch
ormain
if this is the youngest branch)