spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nchammas <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-5964] Allow spark-daemon.sh to support ...
Date Tue, 24 Feb 2015 04:22:02 GMT
Github user nchammas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3881#discussion_r25227849
  
    --- Diff: sbin/spark-daemon.sh ---
    @@ -141,24 +151,36 @@ case $option in
           rsync -a -e ssh --delete --exclude=.svn --exclude='logs/*' --exclude='contrib/hod/logs/*'
$SPARK_MASTER/ "$SPARK_HOME"
         fi
     
    -    spark_rotate_log "$log"
    -    echo "starting $command, logging to $log"
    -    if [ $option == spark-submit ]; then
    -      source "$SPARK_HOME"/bin/utils.sh
    -      gatherSparkSubmitOpts "$@"
    -      nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-submit --class $command
\
    -        "${SUBMISSION_OPTS[@]}" spark-internal "${APPLICATION_OPTS[@]}" >> "$log"
2>&1 < /dev/null &
    -    else
    -      nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >>
"$log" 2>&1 < /dev/null &
    -    fi
    -    newpid=$!
    -    echo $newpid > $pid
    -    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 args=) =~ $command ]]; then
    -      echo "failed to launch $command:"
    -      tail -2 "$log" | sed 's/^/  /'
    -      echo "full log in $log"
    +    if [ "$RUN_IN_FOREGROUND" = "0" ]; then
    +      spark_rotate_log "$log"
    +      echo starting $command, logging to $log
    +      if [ $option == spark-submit ]; then
    +        source "$SPARK_HOME"/bin/utils.sh
    +        gatherSparkSubmitOpts "$@"
    +        nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-submit --class $command
\
    +          "${SUBMISSION_OPTS[@]}" spark-internal "${APPLICATION_OPTS[@]}" >> "$log"
2>&1 < /dev/null &
    +      else
    +        nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >>
"$log" 2>&1 < /dev/null &
    +      fi
    +      newpid=$!
    +      echo $newpid > $pid
    +      sleep 2
    +      # Check if the process has died; in that case we'll tail the log so the user can
see
    +      if ! kill -0 $newpid >/dev/null 2>&1; then
    +        echo "failed to launch $command:"
    +        tail -2 "$log" | sed 's/^/  /'
    +        echo "full log in $log"
    +      fi
    +    else # run in foreground
    +      echo starting $command, logging to stdout
    +      if [ $option == spark-submit ]; then
    +        source "$SPARK_HOME"/bin/utils.sh
    +        gatherSparkSubmitOpts "$@"
    +        nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-submit --class $command \
    --- End diff --
    
    Same as above.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message