Skip to content

HBASE-27335 HBase shell hang for a minute when quiting - #4737

Merged
Apache9 merged 1 commit into
apache:branch-2from
2005hithlj:HBASE-27335
Aug 31, 2022
Merged

HBASE-27335 HBase shell hang for a minute when quiting#4737
Apache9 merged 1 commit into
apache:branch-2from
2005hithlj:HBASE-27335

Conversation

@2005hithlj

Copy link
Copy Markdown
Contributor

@2005hithlj

Copy link
Copy Markdown
ContributorAuthor

@Apache9 sir. Could you take a look? Thanks.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 51sDocker mode activated.
-0 ⚠️yetus0m 6sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall2m 25sbranch-2 passed
+1 💚compile0m 16sbranch-2 passed
+1 💚shadedjars3m 52sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 15sbranch-2 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 3sthe patch passed
+1 💚compile0m 17sthe patch passed
+1 💚javac0m 17sthe patch passed
+1 💚shadedjars3m 56spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 14sthe patch passed
_ Other Tests _
+1 💚unit2m 31shbase-client in the patch passed.
17m 49s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/1/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#4737
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 8ca260d2edcf 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 935b0d2
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/1/testReport/
Max. process+thread count173 (vs. ulimit of 30000)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/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.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 56sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall3m 1sbranch-2 passed
+1 💚compile0m 18sbranch-2 passed
+1 💚shadedjars4m 8sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 18sbranch-2 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 28sthe patch passed
+1 💚compile0m 18sthe patch passed
+1 💚javac0m 18sthe patch passed
+1 💚shadedjars4m 3spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 16sthe patch passed
_ Other Tests _
+1 💚unit2m 44shbase-client in the patch passed.
19m 41s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4737
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 4d6610485f8d 5.4.0-1081-aws #88~18.04.1-Ubuntu SMP Thu Jun 23 16:29:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 935b0d2
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/1/testReport/
Max. process+thread count198 (vs. ulimit of 30000)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/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.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec3m 42sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ branch-2 Compile Tests _
+1 💚mvninstall2m 34sbranch-2 passed
+1 💚compile0m 44sbranch-2 passed
+1 💚checkstyle0m 16sbranch-2 passed
+1 💚spotless0m 41sbranch has no errors when running spotless:check.
+1 💚spotbugs0m 49sbranch-2 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 17sthe patch passed
+1 💚compile0m 42sthe patch passed
+1 💚javac0m 42sthe patch passed
+1 💚checkstyle0m 14sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck8m 41sPatch does not cause any errors with Hadoop 3.2.4 3.3.4.
+1 💚spotless0m 39spatch has no errors when running spotless:check.
+1 💚spotbugs0m 51sthe patch passed
_ Other Tests _
+1 💚asflicense0m 9sThe patch does not generate ASF License warnings.
27m 52s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4737
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 2cc15911cf2d 5.4.0-1083-aws #90~18.04.1-Ubuntu SMP Fri Aug 5 08:12:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 935b0d2
Default JavaAdoptOpenJDK-1.8.0_282-b08
Max. process+thread count64 (vs. ulimit of 30000)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4737/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
Contributor

When quiting, we will not close this connection?

@2005hithlj

Copy link
Copy Markdown
ContributorAuthor

When quiting, we will not close this connection?

@Apache9 sir. Thanks for your review.
I'm not sure if the connection will be closed when exiting from the hbase shell, because I can't find the relevant information in the ruby script. At the same time, no relevant information was found in the master and branch-1 branches. But I will confirm further.

@Apache9

Copy link
Copy Markdown
Contributor

I prefer we first find out why the daemon thread does not quit, because we do not close the connection? Or we have closed the connection but haven't shutdown the thread pool?

@Apache9

Copy link
Copy Markdown
Contributor

I think the problem is that, we defined a shutdown method in hbase.rb where we close the connection in this method, but we never call it in our code base...

I'm not a ruby expert so I'm not sure how to call shutdown when we see 'exit', as seems there is no 'exit' command defined in our code base...

@Apache9

Copy link
Copy Markdown
Contributor
diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb
index f6b3efd945..4bffdaacab 100644
--- a/hbase-shell/src/main/ruby/shell.rb
+++ b/hbase-shell/src/main/ruby/shell.rb
@@ -108,6 +108,9 @@ module Shell
# exit the interactive shell and save that this
# happend via a call to exit
def exit(ret = 0)
+ if self.hbase
+ self.hbase.shutdown
+ end
@exit_code = ret
IRB.irb_exit(IRB.CurrentContext.irb, ret)
end

Apply this to branch-2.5 can make the shell quit immediately when typing 'exit' command, but when calling 'quit' command it will still hang there... I'm not sure how we do we deal with the 'quit' command...

@2005hithlj

Copy link
Copy Markdown
ContributorAuthor

Yes, the 'quit' command is really a difficult thing to deal with. I searched the ruby IRB for info about the 'quit' command, and there is not much info to refer to.

@Apache9

Copy link
Copy Markdown
Contributor

Anyway, let's apply this PR to fix the problem first.

Please open another issue to track the 'releasing resources when quiting IRB' problem @2005hithlj .

Thanks.

@2005hithlj

Copy link
Copy Markdown
ContributorAuthor

@Apache9 OK, sir.

@2005hithlj

Copy link
Copy Markdown
ContributorAuthor

I have created an issue to track this issue:
https://issues.apache.org/jira/browse/HBASE-27348

@Apache9
Apache9 merged commit 6a7a91a into apache:branch-2Aug 31, 2022
Apache9 pushed a commit that referenced this pull request Aug 31, 2022
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 6a7a91a)
Apache9 pushed a commit that referenced this pull request Aug 31, 2022
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 6a7a91a)
bbeaudreault pushed a commit to HubSpot/hbase that referenced this pull request Sep 23, 2022
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 6a7a91a)
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Apr 4, 2024
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 6a7a91a)
(cherry picked from commit fd27d68)
Change-Id: I6e94a26f5ac63396f5f898fdb5b380b9adc06c96
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.

3 participants

@2005hithlj@Apache-HBase@Apache9