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

krathbun pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 188fc549a6 Fixes accumulo-cluster script behavior: (#5730)
188fc549a6 is described below

commit 188fc549a637967b0f7ec0e5b51c1bacdf6fcb04
Author: Kevin Rathbun <krath...@apache.org>
AuthorDate: Thu Jul 24 15:27:53 2025 -0400

    Fixes accumulo-cluster script behavior: (#5730)
    
    * Fixes accumulo-cluster script behavior:
    
    "accumulo-cluster start" would briefly return control back to command
    line, continue execution, then hang but everything seemed to start as
    expected. Cause was background tasks were started and not waited on
    before exiting, but would still complete after exit. So, functionality
    wasn't wrong, it just was strange behavior/confusing to see. Now wait
    for those tasks to complete.
    
    closes #5698
    
    ---------
    
    Co-authored-by: Christopher Tubbs <ctubb...@apache.org>
---
 assemble/bin/accumulo-cluster | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/assemble/bin/accumulo-cluster b/assemble/bin/accumulo-cluster
index 0d747015ed..6e8b4e0df8 100755
--- a/assemble/bin/accumulo-cluster
+++ b/assemble/bin/accumulo-cluster
@@ -276,9 +276,9 @@ function quote() {
   exit 1
 }
 
-# call debug to print, or execute if debug is off
-function debugOrRun() {
-  debug "$(quote "$@")" || "$@"
+# call debug to print the command only, or execute asynchronously if debug is 
off
+function debugOrRunAsync() {
+  debug "$(quote "$@")" || ("$@") &
 }
 
 function canRunOnHost() {
@@ -458,9 +458,9 @@ function execute_command() {
   servers_per_host="${!S:-1}"
 
   if [[ $ARG_LOCAL == 1 ]]; then
-    debugOrRun bash -c "ACCUMULO_CLUSTER_ARG=$servers_per_host 
\"$bin/accumulo-service\" $service $control_cmd -a $host $*"
+    debugOrRunAsync bash -c "ACCUMULO_CLUSTER_ARG=$servers_per_host 
\"$bin/accumulo-service\" $service $control_cmd -a $host $*"
   else
-    debugOrRun "${SSH[@]}" "$host" "bash -c 
'ACCUMULO_CLUSTER_ARG=$servers_per_host \"$bin/accumulo-service\" $service 
$control_cmd -a $host $*'"
+    debugOrRunAsync "${SSH[@]}" "$host" "bash -c 
'ACCUMULO_CLUSTER_ARG=$servers_per_host \"$bin/accumulo-service\" $service 
$control_cmd -a $host $*'"
   fi
 }
 
@@ -659,6 +659,8 @@ function control_services() {
     fi
   fi
 
+  wait
+
 }
 
 function prune_group() {
@@ -844,7 +846,7 @@ function main() {
   conf="${ACCUMULO_CONF_DIR:-$basedir/conf}"
 
   accumulo_cmd="$bin/accumulo"
-  SSH=('ssh' '-qnf' '-o' 'ConnectTimeout=2')
+  SSH=('ssh' '-qn' '-o' 'ConnectTimeout=2' '-o' 'BatchMode=yes')
 
   mapfile -t LOCAL_HOST_ADDRESSES < <(get_localhost_addresses)
   debug "LOCAL_HOST_ADDRESSES=${LOCAL_HOST_ADDRESSES[*]}"

Reply via email to