Repository: spark
Updated Branches:
  refs/heads/branch-2.0 1346f3cd6 -> 93f9f928e


[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.

(cherry picked from commit a3ceb875c64421ced8e52db6d8e51aec9b758e3e)
Signed-off-by: Sean Owen <so...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/93f9f928
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/93f9f928
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/93f9f928

Branch: refs/heads/branch-2.0
Commit: 93f9f928e45988371d7d86f080b4e9971c03fbc9
Parents: 1346f3c
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:27 2016 -0500

----------------------------------------------------------------------
 sbin/spark-daemon.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/93f9f928/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

Reply via email to