You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by ch...@apache.org on 2023/04/19 14:03:27 UTC

[incubator-celeborn] branch branch-0.2 updated: [CELEBORN-533] Bootstrap scripts should use exec to avoid fork subprocess (#1437)

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

chengpan pushed a commit to branch branch-0.2
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/branch-0.2 by this push:
     new 0384b9aad [CELEBORN-533] Bootstrap scripts should use exec to avoid fork subprocess (#1437)
0384b9aad is described below

commit 0384b9aada278aa293e0429e7e118ace6b5cfbb5
Author: zhongqiangchen <zh...@alibaba-inc.com>
AuthorDate: Wed Apr 19 22:00:12 2023 +0800

    [CELEBORN-533] Bootstrap scripts should use exec to avoid fork subprocess (#1437)
    
    * [CELEBORN-533] fix bug that in k8s, SIGTERM can't be catched by worker when worker is shutdown
    
    * add exec command before start_master.sh
    
    * fix master
---
 docker/helm/templates/master-statefulset.yaml | 2 +-
 docker/helm/templates/worker-statefulset.yaml | 2 +-
 sbin/celeborn-daemon.sh                       | 4 ++--
 sbin/start-master.sh                          | 2 +-
 sbin/start-worker.sh                          | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docker/helm/templates/master-statefulset.yaml b/docker/helm/templates/master-statefulset.yaml
index a76025e4c..dfaafe26a 100644
--- a/docker/helm/templates/master-statefulset.yaml
+++ b/docker/helm/templates/master-statefulset.yaml
@@ -69,7 +69,7 @@ spec:
           - "--"
           - "/bin/sh"
           - '-c'
-          - "until {{ range until (.Values.masterReplicas |int) }}nslookup celeborn-master-{{ . }}.celeborn-master-svc.svc.{{ $.Values.cluster.name }}.local && {{ end }}true; do echo waiting for master; sleep 2; done && /opt/celeborn/sbin/start-master.sh"
+          - "until {{ range until (.Values.masterReplicas |int) }}nslookup celeborn-master-{{ . }}.celeborn-master-svc.svc.{{ $.Values.cluster.name }}.local && {{ end }}true; do echo waiting for master; sleep 2; done && exec /opt/celeborn/sbin/start-master.sh"
         resources:
           {{- toYaml .Values.resources.master | nindent 12 }}
         ports:
diff --git a/docker/helm/templates/worker-statefulset.yaml b/docker/helm/templates/worker-statefulset.yaml
index 71024a527..87189c5cf 100644
--- a/docker/helm/templates/worker-statefulset.yaml
+++ b/docker/helm/templates/worker-statefulset.yaml
@@ -69,7 +69,7 @@ spec:
           - "--"
           - "/bin/sh"
           - '-c'
-          - "until {{ range until (.Values.masterReplicas |int) }}nslookup celeborn-master-{{ . }}.celeborn-master-svc.svc.{{ $.Values.cluster.name }}.local && {{ end }}true; do echo waiting for master; sleep 2; done && /opt/celeborn/sbin/start-worker.sh"
+          - "until {{ range until (.Values.masterReplicas |int) }}nslookup celeborn-master-{{ . }}.celeborn-master-svc.svc.{{ $.Values.cluster.name }}.local && {{ end }}true; do echo waiting for master; sleep 2; done && exec /opt/celeborn/sbin/start-worker.sh"
         resources:
           {{- toYaml .Values.resources.worker | nindent 12 }}
         ports:
diff --git a/sbin/celeborn-daemon.sh b/sbin/celeborn-daemon.sh
index ce53cdcde..3937ad64d 100755
--- a/sbin/celeborn-daemon.sh
+++ b/sbin/celeborn-daemon.sh
@@ -118,7 +118,7 @@ fi
 
 execute_command() {
   if [ -z ${CELEBORN_NO_DAEMONIZE+set} ]; then
-      nohup -- "$@" >> $log 2>&1 < /dev/null &
+      exec nohup -- "$@" >> $log 2>&1 < /dev/null &
       newpid="$!"
 
       echo "$newpid" > "$pid"
@@ -140,7 +140,7 @@ execute_command() {
         echo "full log in $log"
       fi
   else
-      "$@"
+      exec "$@"
   fi
 }
 
diff --git a/sbin/start-master.sh b/sbin/start-master.sh
index 76e6e2c05..81a7feb93 100755
--- a/sbin/start-master.sh
+++ b/sbin/start-master.sh
@@ -30,4 +30,4 @@ fi
 
 export CELEBORN_JAVA_OPTS="-Xmx$CELEBORN_MASTER_MEMORY $CELEBORN_MASTER_JAVA_OPTS"
 
-"${CELEBORN_HOME}/sbin/celeborn-daemon.sh" start org.apache.celeborn.service.deploy.master.Master 1 "$@"
\ No newline at end of file
+exec "${CELEBORN_HOME}/sbin/celeborn-daemon.sh" start org.apache.celeborn.service.deploy.master.Master 1 "$@"
\ No newline at end of file
diff --git a/sbin/start-worker.sh b/sbin/start-worker.sh
index ee29861d6..a0571a697 100755
--- a/sbin/start-worker.sh
+++ b/sbin/start-worker.sh
@@ -42,4 +42,4 @@ if [ "$WORKER_INSTANCE" = "" ]; then
   WORKER_INSTANCE=1
 fi
 
-"${CELEBORN_HOME}/sbin/celeborn-daemon.sh" start org.apache.celeborn.service.deploy.worker.Worker "$WORKER_INSTANCE" "$@"
\ No newline at end of file
+exec "${CELEBORN_HOME}/sbin/celeborn-daemon.sh" start org.apache.celeborn.service.deploy.worker.Worker "$WORKER_INSTANCE" "$@"
\ No newline at end of file