You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by me...@apache.org on 2024/02/07 12:10:26 UTC

(hbase) branch branch-2 updated: HBASE-28345 Close HBase connection on exit from HBase Shell (#5665)

This is an automated email from the ASF dual-hosted git repository.

meszibalu pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 5735b83c647 HBASE-28345 Close HBase connection on exit from HBase Shell (#5665)
5735b83c647 is described below

commit 5735b83c64726bc5797dd175f06dce9dbd714232
Author: Istvan Toth <st...@apache.org>
AuthorDate: Wed Feb 7 13:06:11 2024 +0100

    HBASE-28345 Close HBase connection on exit from HBase Shell (#5665)
    
    Signed-off-by: Wellington Chevreuil <wc...@apache.org>
    Signed-off-by: Balazs Meszaros <me...@apache.org>
---
 hbase-shell/src/main/ruby/shell.rb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb
index 3d95aa1623b..e7ae41200f4 100644
--- a/hbase-shell/src/main/ruby/shell.rb
+++ b/hbase-shell/src/main/ruby/shell.rb
@@ -108,6 +108,11 @@ module 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