-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26469 correct HBase shell exit behavior to match code passed to exit #4018
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
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.
Thanks for this fix, @busbey!
Do you think any of the rubocop warnings make sense? https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4018/1/artifact/yetus-general-check/output/diff-patch-rubocop.txt
yeah most of them do, even if most are in relocated old code. I'll see which of them I can correct before merging. some of the IRB interactions might be v specific due to the quirks of that library. |
… exit (#4018) * refactors how we handle running the passed in initialization script to make use of IRB sessions directly instead of reimplementing things ourselves * simplify how we initialize our IRB config * insert a shim for capturing exit codes passed via user calls to exit * make use of user provided exit code unless we're reading stdin in interactive mode This changes the exit code of the shell * a 0 return code, or no return code, passed to a call to exit from stdin in non-interactive mode will now exit cleanly. in prior versions this would have exitted with an error and non-zero exit code. * for other combinations of passing in an initilization script or reading from stdin with using the non-interactive flag, the exit code being 0 or non-0 should now line up with releases prior to 2.4.z, which is a change in behavior compared to 2.4.z. Signed-off-by: Peter Somogyi <psomogyi@apache.org>
… exit (#4018) * refactors how we handle running the passed in initialization script to make use of IRB sessions directly instead of reimplementing things ourselves * simplify how we initialize our IRB config * insert a shim for capturing exit codes passed via user calls to exit * make use of user provided exit code unless we're reading stdin in interactive mode This changes the exit code of the shell * a 0 return code, or no return code, passed to a call to exit from stdin in non-interactive mode will now exit cleanly. in prior versions this would have exitted with an error and non-zero exit code. * for other combinations of passing in an initilization script or reading from stdin with using the non-interactive flag, the exit code being 0 or non-0 should now line up with releases prior to 2.4.z, which is a change in behavior compared to 2.4.z. Signed-off-by: Peter Somogyi <psomogyi@apache.org> (cherry picked from commit 821e6a3)
… exit (#4018) * refactors how we handle running the passed in initialization script to make use of IRB sessions directly instead of reimplementing things ourselves * simplify how we initialize our IRB config * insert a shim for capturing exit codes passed via user calls to exit * make use of user provided exit code unless we're reading stdin in interactive mode This changes the exit code of the shell * a 0 return code, or no return code, passed to a call to exit from stdin in non-interactive mode will now exit cleanly. in prior versions this would have exitted with an error and non-zero exit code. * for other combinations of passing in an initilization script or reading from stdin with using the non-interactive flag, the exit code being 0 or non-0 should now line up with releases prior to 2.4.z, which is a change in behavior compared to 2.4.z. Signed-off-by: Peter Somogyi <psomogyi@apache.org> (cherry picked from commit 821e6a3)
… exit (#4018) * refactors how we handle running the passed in initialization script to make use of IRB sessions directly instead of reimplementing things ourselves * simplify how we initialize our IRB config * insert a shim for capturing exit codes passed via user calls to exit * make use of user provided exit code unless we're reading stdin in interactive mode This changes the exit code of the shell. Note that the below can be summarized as lining up with behavior from earlier HBase releases. This behavior changes in future 2.5+ releases of HBase and you should see the jira for more details. * exit called in an initialization script will result in a non-zero exit code iff a non-zero code is passed to the exit call. * when reading user input from stdin, a call to exit will result in a 0 exit code if the shell is interactive, and a non-zero exit code if the shell is non-interactive. any optional code passed to the call to exit won't change wether the exit code is zero or non-zero. Signed-off-by: Peter Somogyi <psomogyi@apache.org> (cherry picked from commit 821e6a3)
… exit (apache#4018) * refactors how we handle running the passed in initialization script to make use of IRB sessions directly instead of reimplementing things ourselves * simplify how we initialize our IRB config * insert a shim for capturing exit codes passed via user calls to exit * make use of user provided exit code unless we're reading stdin in interactive mode This changes the exit code of the shell. Note that the below can be summarized as lining up with behavior from earlier HBase releases. This behavior changes in future 2.5+ releases of HBase and you should see the jira for more details. * exit called in an initialization script will result in a non-zero exit code iff a non-zero code is passed to the exit call. * when reading user input from stdin, a call to exit will result in a 0 exit code if the shell is interactive, and a non-zero exit code if the shell is non-interactive. any optional code passed to the call to exit won't change wether the exit code is zero or non-zero. Signed-off-by: Peter Somogyi <psomogyi@apache.org> (cherry picked from commit 821e6a3) (cherry picked from commit 8b370f7) Change-Id: Id2a201e3355ea70cac5ed4d9dc66042e7cd4ed55
For previous discussion see HBASE-26469 and the draft PR #3901
Based on those discussions, this patch
exit
for comparison to previously provided summaries of return codes, this patch results in: