Skip to content
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

HBASE-28353 Close HBase connection on implicit exit from HBase shell #5673

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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