Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B1B7E200B6B for ; Thu, 14 Jul 2016 22:28:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B05FE160A63; Thu, 14 Jul 2016 20:28:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DE450160A85 for ; Thu, 14 Jul 2016 22:28:22 +0200 (CEST) Received: (qmail 3758 invoked by uid 500); 14 Jul 2016 20:28:21 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 3523 invoked by uid 99); 14 Jul 2016 20:28:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2016 20:28:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 3523C2C02A7 for ; Thu, 14 Jul 2016 20:28:21 +0000 (UTC) Date: Thu, 14 Jul 2016 20:28:21 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4208) Support Running Flink processes in foreground mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 14 Jul 2016 20:28:23 -0000 [ https://issues.apache.org/jira/browse/FLINK-4208?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1537= 8305#comment-15378305 ]=20 ASF GitHub Bot commented on FLINK-4208: --------------------------------------- Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/2239#discussion_r70877433 =20 --- Diff: flink-dist/src/main/flink-bin/bin/flink-daemon.sh --- @@ -77,31 +77,36 @@ if [[ ${JAVA_VERSION} =3D~ ${IS_NUMBER} ]]; then fi =20 case $STARTSTOP in + (start|start-foreground) + # Rotate log files + rotateLogFile $log + rotateLogFile $out + + # Print a warning if daemons are already running on host + if [ -f $pid ]; then + active=3D() + while IFS=3D'' read -r p || [[ -n "$p" ]]; do + kill -0 $p >/dev/null 2>&1 + if [ $? -eq 0 ]; then + active+=3D($p) + fi + done < "${pid}" =20 - (start) - # Rotate log files - rotateLogFile $log - rotateLogFile $out - - # Print a warning if daemons are already running on host - if [ -f $pid ]; then - active=3D() - while IFS=3D'' read -r p || [[ -n "$p" ]]; do - kill -0 $p >/dev/null 2>&1 - if [ $? -eq 0 ]; then - active+=3D($p) - fi - done < "${pid}" - - count=3D"${#active[@]}" + count=3D"${#active[@]}" =20 - if [ ${count} -gt 0 ]; then - echo "[INFO] $count instance(s) of $DAEMON are already run= ning on $HOSTNAME." - fi + if [ ${count} -gt 0 ]; then + echo "[INFO] $count instance(s) of $DAEMON are already runni= ng on $HOSTNAME." fi + fi + + if [[ $STARTSTOP =3D=3D "start-foreground" ]]; then + echo "Starting $DAEMON as a foreground process on host $HOSTNA= ME." + $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}"= -classpath "`manglePathList "$FLINK_TM_CLASSPATH:$INTERNAL_HADOOP_CLASSPAT= HS"`" ${CLASS_TO_RUN} "${ARGS[@]}" > "$out" 2>&1 < /dev/null + fi =20 + if [[ $STARTSTOP =3D=3D "start" ]]; then echo "Starting $DAEMON daemon on host $HOSTNAME." - $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}"= -classpath "`manglePathList "$FLINK_TM_CLASSPATH:$INTERNAL_HADOOP_CLASSPAT= HS"`" ${CLASS_TO_RUN} "${ARGS[@]}" > "$out" 2>&1 < /dev/null & + nohup $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_settin= g[@]}" -classpath "`manglePathList "$FLINK_TM_CLASSPATH:$INTERNAL_HADOOP_CL= ASSPATHS"`" ${CLASS_TO_RUN} "${ARGS[@]}" > "$out" 2>&1 < /dev/null & --- End diff -- =20 This is excellent documentation. It looks like (from a `grep daemon` th= rough the code) that Flink is daemonizing its threads internally. Perhaps @= StephanEwen can look at this. > Support Running Flink processes in foreground mode > -------------------------------------------------- > > Key: FLINK-4208 > URL: https://issues.apache.org/jira/browse/FLINK-4208 > Project: Flink > Issue Type: Improvement > Reporter: Isma=C3=ABl Mej=C3=ADa > Priority: Minor > > Flink clusters are started automatically in daemon mode, this is definite= ly the default case, however if we want to start containers based on flinks= , the execution context gets lost. Running flink as foreground processes ca= n fix this. -- This message was sent by Atlassian JIRA (v6.3.4#6332)