HBASE-30370 Shell exits on errors other than NameError and SyntaxError - #8629
HBASE-30370 Shell exits on errors other than NameError and SyntaxError#8629junegunn wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adjusts HBase Shell IRB error handling so interactive sessions no longer exit on most runtime errors, while scripted/non-interactive runs still abort to set an appropriate process exit code (HBASE-30370).
Changes:
- Introduces an
@exit_on_errorflag to conditionally re-raise exceptions only for scripts / non-interactive runs. - Simplifies exception handling in
eval_inputby removing special-cases forNameError/SyntaxErrorin favor of unified behavior. - Adds regression tests verifying interactive sessions continue after errors and file-based script runs still abort.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| hbase-shell/src/test/ruby/shell/general_test_cluster.rb | Adds tests covering interactive-vs-script error behavior; introduces Tempfile usage for script simulation. |
| hbase-shell/src/main/ruby/irb/hirb.rb | Implements conditional re-raise via @exit_on_error to prevent killing interactive sessions on runtime errors. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
HBASE-26741 made eval_input re-raise every exception to set an exit code, which also ended interactive sessions. Worked around since for NameError (HBASE-26880) and SyntaxError (HBASE-27726); every other error still killed the prompt. Re-raise only when the exit code is used: a script run, or -n. Everything else falls through to handle_exception, as before HBASE-26741. A script given as an argument runs with interactive still true, so detect it by the FileInputMethod that HBaseLoader.file_for_load returns rather than by @Interactive alone.
5fd0118 to
b64febf
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Jira: HBASE-30370
HBASE-26741 made eval_input re-raise every exception to set an exit code, which also ended interactive sessions. Worked around since for
NameError(HBASE-26880) andSyntaxError(HBASE-27726); every other error still killed the prompt.Re-raise only when the exit code is used: a script run, or
-n. Everything else falls through tohandle_exception, as before HBASE-26741.A script given as an argument runs with interactive still true, so detect it by the
FileInputMethodthatHBaseLoader.file_for_loadreturns rather than by@interactivealone.