-
Notifications
You must be signed in to change notification settings - Fork 3.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
HBASE-27651 hbase-daemon.sh foreground_start should propagate SIGHUP and SIGTERM #5035
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
LGTM.
The hard part here is trying the various combinations out and studying you get the appropriate behavior. Maybe say here what you did testing?
Good stuff Nick.
{ | ||
# pass through SIGHUP if we can | ||
if [ -f "${HBASE_PID}" ] ; then | ||
kill -s HUP "$(cat "${HBASE_PID}")" |
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.
You'd rather see the output than /dev/null it? And does the old pid stick around now?
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.
Testing in a docker container that disappears... I'm guessing that this script already handles the pid file, but let me look more closely...
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.
Oh. cleanupAfterRun
handles the pid file.
…and SIGTERM Introduce separate `trap`s for SIGHUP vs. the rest. Treat `SIGINT`, `SIGKILL`, and `EXIT` identically, as before. Use the signal name without `SIG` prefix for increased portability, as per the POSIX man page for `trap`. `SIGTERM` handler will now honor `HBASE_STOP_TIMEOUT` as described in the file header.
3e59f4d
to
4fdeece
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Looks like this works as we expect. Running in a kubernetes pod, launching the region server container with
|
So in the old code we will always use |
Correct. |
The new code will also honor the documented timeout between sending SIGTERM and SIGKILL. |
Introduce separate
trap
s for SIGHUP vs. the rest. TreatSIGINT
,SIGKILL
, andEXIT
identically, as before. Use the signal name withoutSIG
prefix for increased portability, as per the POSIX man page fortrap
.SIGTERM
handler will now honorHBASE_STOP_TIMEOUT
as described in the file header.