Skip to content

Commit

Permalink
HBASE-28353 Close HBase connection on implicit exit from HBase shell (#…
Browse files Browse the repository at this point in the history
…5673)

Signed-off-by: Bryan Beaudreault <[email protected]>
Signed-off-by: Balazs Meszaros <[email protected]>
  • Loading branch information
stoty authored Feb 13, 2024
1 parent a4002d6 commit 9656006
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hbase-shell/src/main/ruby/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ class Shell
# exit the interactive shell and save that this
# happend via a call to exit
def exit(ret = 0)
# Non-deamon Netty threadpool in ZK ClientCnxnSocketNetty cannot be shut down otherwise
begin
hbase.shutdown
rescue Exception
end
@exit_code = ret
IRB.irb_exit(IRB.CurrentContext.irb, ret)
end
Expand Down Expand Up @@ -323,6 +318,13 @@ def get_workspace
hbase_receiver.send :define_singleton_method, :exit, lambda { |rc = 0|
@shell.exit(rc)
}
at_exit do
# Non-deamon Netty threadpool in ZK ClientCnxnSocketNetty cannot be shut down otherwise
begin
hbase.shutdown
rescue Exception
end
end
::IRB::WorkSpace.new(hbase_receiver.get_binding)
end

Expand Down

0 comments on commit 9656006

Please sign in to comment.