You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/24 15:52:00 UTC
[GitHub] [dolphinscheduler] DarkAssassinator commented on a diff in pull request #12118: [Fix-12109] Fix the errors when starting 2 times with dolphinscheduler-daemon.sh
DarkAssassinator commented on code in PR #12118:
URL: https://github.com/apache/dolphinscheduler/pull/12118#discussion_r979265778
##########
script/dolphinscheduler-daemon.sh:
##########
@@ -81,8 +81,26 @@ else
exit 1
fi
+state=""
+function get_server_running_status() {
+ state="STOP"
+ if [ -f $pid ]; then
+ TARGET_PID=`cat $pid`
+ server_running_count=`ps -p $TARGET_PID --no-headers | wc -l`
+ if [[ $server_running_count -gt 0 ]];then
+ state="RUNNING"
+ fi
+ fi
+}
Review Comment:
IMHO, i think that pid file may not a good idea, because pid just can keep only one process pid
1. If there are two Master process running at same time, but this status function just find one. Becuase if use just call start.sh may start a process again.
2. If user use `kill` command, cannot clear this pid
3. Some misopeation may clear or modify this pid file.
i think the result of using the `ps -ef` check is more accurate and reliable. Personal opinion,just for reference.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org