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:00:18 UTC
[incubator-celeborn] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new d531ec499 [CELEBORN-533] Bootstrap scripts should use exec to avoid fork subprocess (#1437)
d531ec499 is described below
commit d531ec499e770a92c33311b609ab8c632ab8f65b
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
---
charts/celeborn/templates/master-statefulset.yaml | 2 +-
charts/celeborn/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/charts/celeborn/templates/master-statefulset.yaml b/charts/celeborn/templates/master-statefulset.yaml
index 72821473e..158ba36a1 100644
--- a/charts/celeborn/templates/master-statefulset.yaml
+++ b/charts/celeborn/templates/master-statefulset.yaml
@@ -81,7 +81,7 @@ spec:
- "/bin/sh"
- '-c'
{{- $namespace := .Release.Namespace }}
- - "until {{ range until (.Values.masterReplicas |int) }}nslookup celeborn-master-{{ . }}.celeborn-master-svc.{{ $namespace }}.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.{{ $namespace }}.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/charts/celeborn/templates/worker-statefulset.yaml b/charts/celeborn/templates/worker-statefulset.yaml
index c4f6dc6d8..9f70d6c96 100644
--- a/charts/celeborn/templates/worker-statefulset.yaml
+++ b/charts/celeborn/templates/worker-statefulset.yaml
@@ -81,7 +81,7 @@ spec:
- "/bin/sh"
- '-c'
{{- $namespace := .Release.Namespace }}
- - "until {{ range until (.Values.masterReplicas |int) }}nslookup celeborn-master-{{ . }}.celeborn-master-svc.{{ $namespace }}.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.{{ $namespace }}.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 94c2e6566..fce71bb27 100755
--- a/sbin/celeborn-daemon.sh
+++ b/sbin/celeborn-daemon.sh
@@ -101,7 +101,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"
@@ -123,7 +123,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 f05aee463..6a1f75304 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 a4f055e78..048be6b5e 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