Repository: spark Updated Branches: refs/heads/master 4e7393311 -> a3ceb875c
[SPARK-15203][DEPLOY] The spark daemon shell script error, daemon process start successfully but script output fail message ## What changes were proposed in this pull request? fix the bug: The spark daemon shell script error, daemon process start successfully but script output fail message ## How was this patch tested? existing test. Author: WeichenXu <weichenxu...@outlook.com> Closes #13172 from WeichenXu123/fix-spark-15203. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a3ceb875 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a3ceb875 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a3ceb875 Branch: refs/heads/master Commit: a3ceb875c64421ced8e52db6d8e51aec9b758e3e Parents: 4e73933 Author: WeichenXu <weichenxu...@outlook.com> Authored: Fri May 20 08:17:19 2016 -0500 Committer: Sean Owen <so...@cloudera.com> Committed: Fri May 20 08:17:19 2016 -0500 ---------------------------------------------------------------------- sbin/spark-daemon.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/a3ceb875/sbin/spark-daemon.sh ---------------------------------------------------------------------- diff --git a/sbin/spark-daemon.sh b/sbin/spark-daemon.sh index 6ab57df..5982357 100755 --- a/sbin/spark-daemon.sh +++ b/sbin/spark-daemon.sh @@ -162,6 +162,16 @@ run_command() { esac echo "$newpid" > "$pid" + + #Poll for up to 5 seconds for the java process to start + for i in {1..10} + do + if [[ $(ps -p "$newpid" -o comm=) =~ "java" ]]; then + break + fi + sleep 0.5 + done + sleep 2 # Check if the process has died; in that case we'll tail the log so the user can see if [[ ! $(ps -p "$newpid" -o comm=) =~ "java" ]]; then --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org