Skip to content

HBASE-26772 Shell suspended in background - #4137

Merged
petersomogyi merged 1 commit into
apache:masterfrom
petersomogyi:HBASE-26772
Mar 1, 2022
Merged

HBASE-26772 Shell suspended in background#4137
petersomogyi merged 1 commit into
apache:masterfrom
petersomogyi:HBASE-26772

Conversation

@petersomogyi

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 6sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall2m 41smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 22sthe patch passed
-0 ⚠️rubocop0m 5sThe patch generated 3 new + 47 unchanged - 1 fixed = 50 total (was 48)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
_ Other Tests _
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
7m 17s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4137
Optional Testsdupname asflicense javac rubocop
unameLinux c06bb1738b1b 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 5dc663e
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/2/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count45 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/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 🆗reexec1m 4sDocker 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 💚mvninstall2m 38smaster passed
+1 💚javadoc0m 11smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 27sthe patch passed
+1 💚javadoc0m 11sthe patch passed
_ Other Tests _
+1 💚unit8m 39shbase-shell in the patch passed.
15m 50s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4137
Optional Testsjavac javadoc unit
unameLinux 45a78edd3ab1 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 5dc663e
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/2/testReport/
Max. process+thread count794 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/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 🆗reexec0m 27sDocker 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 💚mvninstall3m 6smaster passed
+1 💚javadoc0m 12smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 49sthe patch passed
+1 💚javadoc0m 11sthe patch passed
_ Other Tests _
+1 💚unit9m 44shbase-shell in the patch passed.
17m 8s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4137
Optional Testsjavac javadoc unit
unameLinux 57f0c3660a38 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 5dc663e
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/2/testReport/
Max. process+thread count849 (vs. ulimit of 30000)
modulesC: hbase-shell U: hbase-shell
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4137/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.

@busbey

Copy link
Copy Markdown
Contributor

Change looks reasonable to me. Holding off on an approval until I can test run things locally. Feel free to proceed if someone else comes along before I get to finish.

@busbey

Copy link
Copy Markdown
Contributor

okay so before this change, I can replicate the problem described in the jira:

(base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % (echo "list"| ./bin/hbase shell -n)
2022-02-26T11:48:32,236 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
reading from ~/.irbrc
hbase:001:0> list
TABLE 0 row(s)
Took 0.7729 seconds => []
hbase:002:0> (base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % (echo "list"| ./bin/hbase shell -n) &
[1] 53337
(base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % [1] + suspended (tty output) ( echo"list"| ./bin/hbase shell -n; )
(base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % fg
[1] + continued ( echo"list"| ./bin/hbase shell -n; )
2022-02-26T11:49:07,536 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
reading from ~/.irbrc
hbase:001:0> list
TABLE 0 row(s)
Took 0.7193 seconds => []
hbase:002:0> (base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT %

but after the change I still have things hang, just a bit later.

(base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % (echo "list" | ./bin/hbase shell -n) &
[1] 54168
(base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % 2022-02-26T11:56:54,053 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
reading from ~/.irbrc
hbase:001:0> list
[1] + suspended (tty output) ( echo "list" | ./bin/hbase shell -n; )
(base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT % fg
[1] + continued ( echo "list" | ./bin/hbase shell -n; )
TABLE 0 row(s)
Took 155.7721 seconds => []
hbase:002:0> (base) sbusbey@seans-mbp hbase-3.0.0-alpha-3-SNAPSHOT %

Am I messing up the test conditions somehow?

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

Thanks for taking a look @busbey! The difference seems to be with redirecting the output to a file or not. I'm also able to reproduce the problem you've noticed.

The process is suspended now on this line: https://github.com/apache/hbase/blob/master/hbase-shell/src/main/ruby/shell/formatter.rb#L37

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

I'm not able to figure out clean a solution for this when the shell is running in the background but the output is stdout instead of a file. My assumption is operators running shell commands in the background would also redirect the output to a file instead of keeping everything on stdout.

One option would be to add a flag to HBase shell which does not call the refresh_width method.

@busbey

Copy link
Copy Markdown
Contributor

huh. and we already have a tty guard. maybe a bug in checking that stdout is a tty, whereas the guards that are working are checks on stdin?

in any case this seems like a different, even if related, rabbit hole than the one you were chasing here.

@petersomogyi

Copy link
Copy Markdown
ContributorAuthor

huh. and we already have a tty guard. maybe a bug in checking that stdout is a tty, whereas the guards that are working are checks on stdin?

I tried to include stderr to the if statement but in your test case stdout is a tty, however, since the process is in the background the Java.jline.TerminalFactory.get hangs.

@petersomogyi
petersomogyi merged commit 1f2ddbe into apache:masterMar 1, 2022
@petersomogyi
petersomogyi deleted the HBASE-26772 branch March 1, 2022 10:52
petersomogyi added a commit that referenced this pull request Mar 1, 2022
Signed-off-by: Sean Busbey <busbey@apache.org>
petersomogyi added a commit that referenced this pull request Mar 1, 2022
Signed-off-by: Sean Busbey <busbey@apache.org>
petersomogyi added a commit that referenced this pull request Mar 1, 2022
Signed-off-by: Sean Busbey <busbey@apache.org>
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Apr 4, 2024
Signed-off-by: Sean Busbey <busbey@apache.org>
(cherry picked from commit 25dc0eb)
Change-Id: I7ef25ab963d09fd92e5b4c6201f9f178e659c88f
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

@petersomogyi@Apache-HBase@busbey