-
Notifications
You must be signed in to change notification settings - Fork 902
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
Fix the pid occupied check when use bookkeeper-daemon.sh start or stop #3113
Conversation
on which platforms did you test this ? |
Ci is not running for some reason |
perhaps: https://www.githubstatus.com/incidents/fpk08rxnqjz2 can you try to close and reopen the PR ? |
@eolivelli I test the case in on Linux and MacOS. On Linux the 'kill -0 $pid' and 'ps -p $pid' performance diff as the discussion (https://stackoverflow.com/questions/30958964/why-do-kill-0-pid-echo-and-ps-ppid-echo-sometimes-differ);On MacOs, the both exhibit the same result; |
fix old workflow,please see #3455 for detail |
@Nicklee007 Could you please rebase the code? I will push on this forward. Thanks :) |
ccd5f7d
to
529d616
Compare
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 look very nice
but I have a question:
how to verify the correctness of this shell change? there is no relevant testcase for the shell, right?
@StevenLuMT Currently we don't have shell test suite, and it's difficult to built. So I think manual testing is enough |
ok,LGTM |
apache#3113) Master Issue: apache#3112 ### Motivation Fix the failed pid occupied check. we'll fail when use bookkeeper-daemon.sh start or stop bookie, after the last time we exit the bookie direct kill or the bookie occurred non-normal exit, then the bin/bookkeeper-bookie.pid are retained, and the pid in the file is occupied by the thread in other progress. ### Changes Change the pid occupied check from 'kill -0 $pid' to 'ps -p $pid'. The both will return true when the pid is occupied by one progress, but 'kill -0 $pid' will return true and the 'ps -p $pid' will return false when the pid is occupied by one progress's sub thread. StackOverflow discussion: https://stackoverflow.com/questions/30958964/why-do-kill-0-pid-echo-and-ps-ppid-echo-sometimes-differ Co-authored-by: nicklixinyang <nicklixinyang@didiglobal.com>
Master Issue: #3112
Motivation
Fix the failed pid occupied check. we'll fail when use bookkeeper-daemon.sh start or stop bookie, after the last time we exit the bookie direct kill or the bookie occurred non-normal exit, then the bin/bookkeeper-bookie.pid are retained, and the pid in the file is occupied by the thread in other progress.
Changes
Change the pid occupied check from 'kill -0 $pid' to 'ps -p $pid'. The both will return true when the pid is occupied by one progress, but 'kill -0 $pid' will return true and the 'ps -p $pid' will return false when the pid is occupied by one progress's sub thread.
StackOverflow discussion:
https://stackoverflow.com/questions/30958964/why-do-kill-0-pid-echo-and-ps-ppid-echo-sometimes-differ