Skip to content

HBASE-26741 Incorrect exception handling in shell - #4101

Merged
petersomogyi merged 3 commits into
apache:masterfrom
petersomogyi:HBASE-26741
Feb 10, 2022
Merged

HBASE-26741 Incorrect exception handling in shell#4101
petersomogyi merged 3 commits into
apache:masterfrom
petersomogyi:HBASE-26741

Conversation

@petersomogyi

Copy link
Copy Markdown
Contributor

Override eval_input in HIRB to modify exception handling logic.

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

Copy link
Copy Markdown
Contributor

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

@busbey

Copy link
Copy Markdown
Contributor

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

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 25sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall4m 18smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 0sthe patch passed
-0 ⚠️rubocop0m 4sThe patch generated 39 new + 2 unchanged - 0 fixed = 41 total (was 2)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
_ Other Tests _
+1 💚asflicense0m 16sThe patch does not generate ASF License warnings.
10m 45s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense javac rubocop
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 36d8654
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://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 count78 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/console
versionsgit=2.17.1 maven=3.6.3 rubocop=0.80.0
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 34sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall4m 47smaster passed
+1 💚javadoc0m 18smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 32sthe patch passed
+1 💚javadoc0m 15sthe patch passed
_ Other Tests _
+1 💚unit6m 53shbase-shell in the patch passed.
18m 35s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 36d8654
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/testReport/
Max. process+thread count2459 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 57sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall4m 37smaster passed
+1 💚javadoc0m 15smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 21sthe patch passed
+1 💚javadoc0m 13sthe patch passed
_ Other Tests _
+1 💚unit8m 12shbase-shell in the patch passed.
19m 47s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 36d8654
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/testReport/
Max. process+thread count1616 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@joshelserjoshelser left a comment

Copy link
Copy Markdown
Member

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 <matz@netlab.jp>.
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:
...

Comment threadhbase-shell/src/main/ruby/irb/hirb.rb Outdated
Co-authored-by: Josh Elser <josh.elser@gmail.com>
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 32sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall3m 50smaster passed
_ Patch Compile Tests _
+1 💚mvninstall3m 51sthe patch passed
-0 ⚠️rubocop0m 4sThe patch generated 39 new + 2 unchanged - 0 fixed = 41 total (was 2)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
_ Other Tests _
+1 💚asflicense0m 12sThe patch does not generate ASF License warnings.
9m 56s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense javac rubocop
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / fddfcee
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://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 count78 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/console
versionsgit=2.17.1 maven=3.6.3 rubocop=0.80.0
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 58sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall4m 34smaster passed
+1 💚javadoc0m 15smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 23sthe patch passed
+1 💚javadoc0m 12sthe patch passed
_ Other Tests _
+1 💚unit8m 15shbase-shell in the patch passed.
19m 34s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / fddfcee
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/testReport/
Max. process+thread count1616 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec4m 16sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall4m 31smaster passed
+1 💚javadoc0m 15smaster passed
_ Patch Compile Tests _
+1 💚mvninstall4m 35sthe patch passed
+1 💚javadoc0m 15sthe patch passed
_ Other Tests _
+1 💚unit6m 50shbase-shell in the patch passed.
21m 44s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / fddfcee
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/testReport/
Max. process+thread count2445 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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

commands.txtcommands-ok.txtcommands-ok-exit2.txt
non-interactiveexception, 102
interactivefinish, 002
$ 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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 27sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall4m 14smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall4m 1sthe patch passed
-0 ⚠️rubocop0m 4sThe patch generated 39 new + 2 unchanged - 0 fixed = 41 total (was 2)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
_ Other Tests _
+1 💚asflicense0m 29sThe patch does not generate ASF License warnings.
11m 36s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense javac rubocop
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 0c19a5f
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://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 count78 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/console
versionsgit=2.17.1 maven=3.6.3 rubocop=0.80.0
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@busbey

Copy link
Copy Markdown
Contributor

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

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

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

@joshelserjoshelser left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 24sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for branch
+1 💚mvninstall4m 31smaster passed
+1 💚javadoc3m 8smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for patch
+1 💚mvninstall4m 29sthe patch passed
+1 💚javadoc3m 5sthe patch passed
_ Other Tests _
+1 💚unit190m 26sroot in the patch passed.
210m 12s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 0c19a5f
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/testReport/
Max. process+thread count6992 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec6m 47sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for branch
+1 💚mvninstall4m 17smaster passed
+1 💚javadoc2m 29smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall4m 21sthe patch passed
+1 💚javadoc2m 31sthe patch passed
_ Other Tests _
+1 💚unit428m 39sroot in the patch passed.
451m 57s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 0c19a5f
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/testReport/
Max. process+thread count3768 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4101/3/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@petersomogyi
petersomogyi merged commit 85fadfd into apache:masterFeb 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 <elserj@apache.org>
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 <elserj@apache.org>
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 <elserj@apache.org>
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 <elserj@apache.org>
(cherry picked from commit 3994374)
Change-Id: Ifa97cbbe6a53c7f0ccece36ebb66c6a91b844088
Sign up for freeto 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

@petersomogyi@busbey@Apache-HBase@joshelser