From 041fea46cef8148d0ddfe880eef1f8846840bb07 Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Tue, 6 Feb 2024 16:43:59 +0100 Subject: [PATCH 1/2] HBASE-28345 Close HBase connection on exit from HBase Shell --- 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 414ab9d2bd51..790248bc098f 100644 --- a/hbase-shell/src/main/ruby/shell.rb +++ b/hbase-shell/src/main/ruby/shell.rb @@ -108,6 +108,11 @@ 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 + self.hbase.shutdown + rescue Exception + end @exit_code = ret IRB.irb_exit(IRB.CurrentContext.irb, ret) end From 632519921855aa5ef6083f2be2f2a0844f3a952d Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Tue, 6 Feb 2024 18:27:42 +0100 Subject: [PATCH 2/2] remove self. as suggested by rubocop --- hbase-shell/src/main/ruby/shell.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb index 790248bc098f..39fbd2ccba16 100644 --- a/hbase-shell/src/main/ruby/shell.rb +++ b/hbase-shell/src/main/ruby/shell.rb @@ -110,7 +110,7 @@ class Shell def exit(ret = 0) # Non-deamon Netty threadpool in ZK ClientCnxnSocketNetty cannot be shut down otherwise begin - self.hbase.shutdown + hbase.shutdown rescue Exception end @exit_code = ret