HBASE-28660 list_namespace not working after an incorrect user input (branch-2)#7971
Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:branch-2from
Open
Conversation
Backport of HBASE-28660 to branch-2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
This is a backport of the fix for HBASE-28660 to
branch-2.When a user enters an incorrect command like
list_namespace, 'ns.*', the JRuby parser mistakenly creates a local variable initialized tonilbefore throwing a SyntaxError. Because Ruby prioritizes local variables over method calls, subsequent valid commands return empty/nil instead of executing the actual shell command.How does this PR fix the problem?
hirb.rb'seval_inputloop that was merged into themasterbranch.stderrand safely discards the polluted binding.general_test_cluster.rbcovering all 5 affected commands (list,list_namespace,list_snapshots,scan,processlist).Tests run
Ran the shell tests locally on
branch-2with the Hadoop 3 profile and verified that all tests pass without regressions.mvn test -Dtest=TestShell -pl hbase-shell -Dhadoop.profile=3.0