-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26772 Shell suspended in background #4137
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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. |
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.
Am I messing up the test conditions somehow? |
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 |
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. |
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. |
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 |
Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org> (cherry picked from commit 25dc0eb) Change-Id: I7ef25ab963d09fd92e5b4c6201f9f178e659c88f
No description provided.