Skip to content
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-26741 Incorrect exception handling in shell #4101

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

petersomogyi
Copy link
Contributor

Override eval_input in HIRB to modify exception handling logic.

Override eval_input in HIRB to modify exception handling logic.
@busbey
Copy link
Contributor

busbey commented Feb 8, 2022

where's the specific line this is copied from? we'll need to attribute and update LICENSE info.

@busbey
Copy link
Contributor

busbey commented Feb 8, 2022

what does this behavior look like during the default interactive mode?

@petersomogyi
Copy link
Contributor Author

where's the specific line this is copied from? we'll need to attribute and update LICENSE info.

Copied this method with a single line change: https://github.com/jruby/jruby/blob/9.2.13.0/lib/ruby/stdlib/irb.rb#L440-L537

@petersomogyi
Copy link
Contributor Author

what does this behavior look like during the default interactive mode?

➜  hbase-upstream git:(HBASE-26741) ✗ bin/hbase shell
2022-02-08T17:34:52,336 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/book.html#shell
Version 3.0.0-alpha-3-SNAPSHOT, re848d3b9d95e2c0f3c091285f6ecf50bf9330987, Tue Feb  8 17:02:57 CET 2022
Took 0.0013 seconds
hbase:001:0> scan 'foo'
ROW                                          COLUMN+CELL
2022-02-08T17:35:07,724 WARN  [RPCClient-NioEventLoopGroup-1-2] client.AsyncNonMetaRegionLocator: Failed to locate region in 'foo', row='', locateType=CURRENT
org.apache.hadoop.hbase.TableNotFoundException: foo
	at org.apache.hadoop.hbase.client.AsyncNonMetaRegionLocator$1.onComplete(AsyncNonMetaRegionLocator.java:503) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.client.AsyncClientScanner.lambda$startScan$1(AsyncClientScanner.java:183) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.util.FutureUtils.lambda$addListener$0(FutureUtils.java:68) ~[hbase-common-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:792) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2153) ~[?:1.8.0_242]
	at org.apache.hadoop.hbase.util.FutureUtils.addListener(FutureUtils.java:61) ~[hbase-common-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.client.AsyncClientScanner.startScan(AsyncClientScanner.java:166) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.client.AsyncClientScanner.lambda$openScanner$2(AsyncClientScanner.java:212) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.util.FutureUtils.lambda$addListener$0(FutureUtils.java:68) ~[hbase-common-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:750) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975) ~[?:1.8.0_242]
	at org.apache.hadoop.hbase.client.AsyncSingleRequestRpcRetryingCaller.lambda$call$4(AsyncSingleRequestRpcRetryingCaller.java:90) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.util.FutureUtils.lambda$addListener$0(FutureUtils.java:68) ~[hbase-common-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:750) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975) ~[?:1.8.0_242]
	at org.apache.hadoop.hbase.client.AsyncClientScanner.lambda$callOpenScanner$0(AsyncClientScanner.java:157) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hbase.thirdparty.com.google.protobuf.RpcUtil$1.run(RpcUtil.java:79) [hbase-shaded-protobuf-4.0.1.jar:4.0.1]
	at org.apache.hbase.thirdparty.com.google.protobuf.RpcUtil$1.run(RpcUtil.java:70) [hbase-shaded-protobuf-4.0.1.jar:4.0.1]
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.onCallFinished(AbstractRpcClient.java:395) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.access$100(AbstractRpcClient.java:96) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient$3.run(AbstractRpcClient.java:428) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.AbstractRpcClient$3.run(AbstractRpcClient.java:423) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.Call.callComplete(Call.java:119) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.Call.setResponse(Call.java:151) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.NettyRpcDuplexHandler.readResponse(NettyRpcDuplexHandler.java:188) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.ipc.NettyRpcDuplexHandler.channelRead(NettyRpcDuplexHandler.java:196) [hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [hbase-shaded-netty-4.0.1.jar:?]
	at org.apache.hbase.thirdparty.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [hbase-shaded-netty-4.0.1.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

ERROR: Unknown table foo!

For usage try 'help "scan"'

Took 0.1422 seconds
hbase:002:0> exit
➜  hbase-upstream git:(HBASE-26741) ✗ echo $?
0

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 25s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 4m 18s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 4m 0s the patch passed
-0 ⚠️ rubocop 0m 4s The patch generated 39 new + 2 unchanged - 0 fixed = 41 total (was 2)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 16s The patch does not generate ASF License warnings.
10m 45s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #4101
Optional Tests dupname asflicense javac rubocop
uname Linux 9e15832dc05d 4.15.0-161-generic #169-Ubuntu SMP Fri Oct 15 13:41:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 36d8654
Default Java AdoptOpenJDK-1.8.0_282-b08
rubocop https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count 78 (vs. ulimit of 30000)
modules C: hbase-shell U: hbase-shell
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/console
versions git=2.17.1 maven=3.6.3 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 4m 47s master passed
+1 💚 javadoc 0m 18s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 4m 32s the patch passed
+1 💚 javadoc 0m 15s the patch passed
_ Other Tests _
+1 💚 unit 6m 53s hbase-shell in the patch passed.
18m 35s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #4101
Optional Tests javac javadoc unit
uname Linux 11130ed67023 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 36d8654
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/testReport/
Max. process+thread count 2459 (vs. ulimit of 30000)
modules C: hbase-shell U: hbase-shell
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@petersomogyi
Copy link
Contributor Author

non-interactive mode with exception:

➜  hbase-upstream git:(HBASE-26741) ✗ bin/hbase shell -n commands.txt
2022-02-08T17:37:11,367 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
hbase:001:0> scan 'foo'
ROW                                          COLUMN+CELL
2022-02-08T17:37:17,679 WARN  [RPCClient-NioEventLoopGroup-1-2] client.AsyncNonMetaRegionLocator: Failed to locate region in 'foo', row='', locateType=CURRENT
org.apache.hadoop.hbase.TableNotFoundException: foo
	at org.apache.hadoop.hbase.client.AsyncNonMetaRegionLocator$1.onComplete(AsyncNonMetaRegionLocator.java:503) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
	at org.apache.hadoop.hbase.client.AsyncClientScanner.lambda$startScan$1(AsyncClientScanner.java:183) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
[[[ cropped ]]]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Took 0.1307 seconds                                                                                                                                                           ERROR RuntimeError: Unknown table foo!
➜  hbase-upstream git:(HBASE-26741) ✗ echo $?
1

non-interactive without exceptions and non-zero exit code:

➜  hbase-upstream git:(HBASE-26741) ✗ cat commands-ok.txt
scan 'hbase:meta'
exit 2
➜  hbase-upstream git:(HBASE-26741) ✗ bin/hbase shell -n commands-ok.txt
2022-02-08T17:41:08,845 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
hbase:001:0> scan 'hbase:meta'
ROW                                                    COLUMN+CELL
 default                                               column=ns:d, timestamp=2022-02-08T17:34:31.881, value=\x0A\x07default
 hbase                                                 column=ns:d, timestamp=2022-02-08T17:34:31.889, value=\x0A\x05hbase
2 row(s)
Took 0.1263 seconds
hbase:002:0> exit 2
➜  hbase-upstream git:(HBASE-26741) ✗ echo $?
2

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 57s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 4m 37s master passed
+1 💚 javadoc 0m 15s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 4m 21s the patch passed
+1 💚 javadoc 0m 13s the patch passed
_ Other Tests _
+1 💚 unit 8m 12s hbase-shell in the patch passed.
19m 47s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #4101
Optional Tests javac javadoc unit
uname Linux 38ada80b8ecc 4.15.0-163-generic #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 36d8654
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/testReport/
Max. process+thread count 1616 (vs. ulimit of 30000)
modules C: hbase-shell U: hbase-shell
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Member

@joshelser joshelser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see the comment expanded and a unit test to cover this, too.

JRuby appears to be 2-clause bsd (assuming BSDL is not unique to the standard BSD license...)

JRuby distributes some ruby modules which are distributed under Ruby
license:

Ruby is copyrighted free software by Yukihiro Matsumoto <[email protected]>.
You can redistribute it and/or modify it under either the terms of the
2-clause BSDL (see the file BSDL), or the conditions below:
...

hbase-shell/src/main/ruby/irb/hirb.rb Outdated Show resolved Hide resolved
Co-authored-by: Josh Elser <[email protected]>
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 3m 50s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 51s the patch passed
-0 ⚠️ rubocop 0m 4s The patch generated 39 new + 2 unchanged - 0 fixed = 41 total (was 2)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 12s The patch does not generate ASF License warnings.
9m 56s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #4101
Optional Tests dupname asflicense javac rubocop
uname Linux b98717caac9f 4.15.0-161-generic #169-Ubuntu SMP Fri Oct 15 13:41:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / fddfcee
Default Java AdoptOpenJDK-1.8.0_282-b08
rubocop https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count 78 (vs. ulimit of 30000)
modules C: hbase-shell U: hbase-shell
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/console
versions git=2.17.1 maven=3.6.3 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 58s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 4m 34s master passed
+1 💚 javadoc 0m 15s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 4m 23s the patch passed
+1 💚 javadoc 0m 12s the patch passed
_ Other Tests _
+1 💚 unit 8m 15s hbase-shell in the patch passed.
19m 34s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #4101
Optional Tests javac javadoc unit
uname Linux 360f58a7b933 4.15.0-163-generic #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / fddfcee
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/testReport/
Max. process+thread count 1616 (vs. ulimit of 30000)
modules C: hbase-shell U: hbase-shell
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 4m 16s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 4m 31s master passed
+1 💚 javadoc 0m 15s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 4m 35s the patch passed
+1 💚 javadoc 0m 15s the patch passed
_ Other Tests _
+1 💚 unit 6m 50s hbase-shell in the patch passed.
21m 44s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #4101
Optional Tests javac javadoc unit
uname Linux 7381b0b44b38 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / fddfcee
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/testReport/
Max. process+thread count 2445 (vs. ulimit of 30000)
modules C: hbase-shell U: hbase-shell
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@petersomogyi
Copy link
Contributor Author

JRuby appears to be 2-clause bsd (assuming BSDL is not unique to the standard BSD license...)

The irb.rb file (and the duplicated method) is originally from Ruby and not JRuby: https://github.com/ruby/irb/blob/9d7ba836eb1ec8ec71b6a24e9683ba96fe3fb72b/lib/irb.rb#L441-L537

This repository is using BSD 2-Clause which is a Category A license by ASF policies: https://www.apache.org/legal/resolved.html#category-a

unit test to cover this

I'm not yet sure how to do that. We have existing tests for shell command execution throwing exception in non-interactive mode but these tests don't use IRB.run underneath.

@petersomogyi
Copy link
Contributor Author

Manual testing shows these results, matching the behavior of HBase 2.2.7.

commands.txt commands-ok.txt commands-ok-exit2.txt
non-interactive exception, 1 0 2
interactive finish, 0 0 2
$ cat commands.txt
scan 'foo'
exit
$ cat commands-ok.txt
scan 'hbase:meta'
exit
$ cat commands-ok-exit2.txt
scan 'hbase:meta'
exit 2

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 27s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 4m 14s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 4m 1s the patch passed
-0 ⚠️ rubocop 0m 4s The patch generated 39 new + 2 unchanged - 0 fixed = 41 total (was 2)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 29s The patch does not generate ASF License warnings.
11m 36s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #4101
Optional Tests dupname asflicense javac rubocop
uname Linux 78ac4dfbb06d 4.15.0-161-generic #169-Ubuntu SMP Fri Oct 15 13:41:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 0c19a5f
Default Java AdoptOpenJDK-1.8.0_282-b08
rubocop https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count 78 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/console
versions git=2.17.1 maven=3.6.3 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@busbey
Copy link
Contributor

busbey commented Feb 9, 2022

what happens to stuff that comes from stdin in non-interactive mode? (in 2.2 and with this patch)

@petersomogyi
Copy link
Contributor Author

what happens to stuff that comes from stdin in non-interactive mode? (in 2.2 and with this patch)

The behavior is identical. Both quits on exceptions with exit code 1.
The formatting is different because on master we have the hbase shell prompt and the stack trace.

➜  hbase-2.2.7 bin/hbase shell -n
2022-02-09 16:14:26,755 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
scan 'foo'
ROW                                  COLUMN+CELL
Took 0.3674 seconds                                                                                                                         ERROR RuntimeError: Unknown table foo!
➜  hbase-2.2.7 echo $?
1
➜  hbase-upstream git:(HBASE-26741) ✗ bin/hbase shell -n
2022-02-09T16:13:30,894 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
hbase:001:0> scan 'foo'
ROW                                                    COLUMN+CELL
2022-02-09T16:13:41,173 WARN  [RPCClient-NioEventLoopGroup-1-2] client.AsyncNonMetaRegionLocator: Failed to locate region in 'foo', row='', locateType=CURRENT
org.apache.hadoop.hbase.TableNotFoundException: foo
	at org.apache.hadoop.hbase.client.AsyncNonMetaRegionLocator$1.onComplete(AsyncNonMetaRegionLocator.java:503) ~[hbase-client-3.0.0-alpha-3-SNAPSHOT.jar:3.0.0-alpha-3-SNAPSHOT]
[[[ LONG STACKTRACE ]]]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Took 0.1328 seconds                                                                                                                                                                                                 RuntimeError: Unknown table foo!
  translate_hbase_exceptions at /Users/petersomogyi/projects/hbase-upstream/hbase-shell/src/main/ruby/shell/commands.rb:130
                command_safe at /Users/petersomogyi/projects/hbase-upstream/hbase-shell/src/main/ruby/shell/commands.rb:49
            internal_command at uri:classloader:/shell.rb:211
                     command at uri:classloader:/shell.rb:203
                        scan at uri:classloader:/shell.rb:166
                    evaluate at (hbase):1
                        eval at org/jruby/RubyKernel.java:1048
                    evaluate at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/workspace.rb:85
                    evaluate at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/context.rb:380
                  eval_input at /Users/petersomogyi/projects/hbase-upstream/hbase-shell/src/main/ruby/irb/hirb.rb:112
               signal_status at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:623
                  eval_input at /Users/petersomogyi/projects/hbase-upstream/hbase-shell/src/main/ruby/irb/hirb.rb:109
    each_top_level_statement at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/ruby-lex.rb:246
                        loop at org/jruby/RubyKernel.java:1442
    each_top_level_statement at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/ruby-lex.rb:232
                       catch at org/jruby/RubyKernel.java:1189
    each_top_level_statement at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb/ruby-lex.rb:231
                  eval_input at /Users/petersomogyi/projects/hbase-upstream/hbase-shell/src/main/ruby/irb/hirb.rb:108
                         run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:428
                       catch at org/jruby/RubyKernel.java:1189
                         run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/irb.rb:427
                      <main> at /Users/petersomogyi/projects/hbase-upstream/bin/../hbase-shell/src/main/ruby/jar-bootstrap.rb:223
➜  hbase-upstream git:(HBASE-26741) ✗ echo $?
1

Copy link
Member

@joshelser joshelser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is breaking stuff downstream that we'd like to get fixed (sadly, urgently), so I'm +1 to fix the immediate problem and then follow-up a unit-test to codify the expected functionality.

Shout if you're not OK with that @busbey

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 24s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for branch
+1 💚 mvninstall 4m 31s master passed
+1 💚 javadoc 3m 8s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 4m 29s the patch passed
+1 💚 javadoc 3m 5s the patch passed
_ Other Tests _
+1 💚 unit 190m 26s root in the patch passed.
210m 12s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #4101
Optional Tests javac javadoc unit
uname Linux 4143a0ad54a2 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 0c19a5f
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/testReport/
Max. process+thread count 6992 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 6m 47s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for branch
+1 💚 mvninstall 4m 17s master passed
+1 💚 javadoc 2m 29s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 4m 21s the patch passed
+1 💚 javadoc 2m 31s the patch passed
_ Other Tests _
+1 💚 unit 428m 39s root in the patch passed.
451m 57s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #4101
Optional Tests javac javadoc unit
uname Linux 6f6061783a3b 4.15.0-163-generic #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 0c19a5f
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/testReport/
Max. process+thread count 3768 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@petersomogyi petersomogyi merged commit 85fadfd into apache:master Feb 10, 2022
petersomogyi added a commit that referenced this pull request Feb 10, 2022
Override eval_input in HIRB to modify exception handling logic.

Signed-off-by: Josh Elser <[email protected]>
petersomogyi added a commit that referenced this pull request Feb 10, 2022
Override eval_input in HIRB to modify exception handling logic.

Signed-off-by: Josh Elser <[email protected]>
petersomogyi added a commit that referenced this pull request Feb 10, 2022
Override eval_input in HIRB to modify exception handling logic.

Signed-off-by: Josh Elser <[email protected]>
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Apr 4, 2024
Override eval_input in HIRB to modify exception handling logic.

Signed-off-by: Josh Elser <[email protected]>
(cherry picked from commit 3994374)
Change-Id: Ifa97cbbe6a53c7f0ccece36ebb66c6a91b844088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants