From 2f0a91b64ee312bb5fb33885118afac4b7d0dc91 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 26 Oct 2018 09:01:30 -0700 Subject: [PATCH 1/6] fix mvn to not always exit 1 --- build/mvn | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/build/mvn b/build/mvn index b60ea644b262d..8b16d09a1ad17 100755 --- a/build/mvn +++ b/build/mvn @@ -153,7 +153,7 @@ if [ -n "${ZINC_INSTALL_FLAG}" -o -z "`"${ZINC_BIN}" -status -port ${ZINC_PORT}` export ZINC_OPTS=${ZINC_OPTS:-"$_COMPILE_JVM_OPTS"} "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} "${ZINC_BIN}" -start -port ${ZINC_PORT} \ - -server 127.0.0.1 -idle-timeout 30m \ + -server 127.0.0.1 -idle-timeout 3h \ -scala-compiler "${SCALA_COMPILER}" \ -scala-library "${SCALA_LIBRARY}" &>/dev/null fi @@ -163,8 +163,19 @@ export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"} echo "Using \`mvn\` from path: $MVN_BIN" 1>&2 -# Last, call the `mvn` command as usual +# call the `mvn` command as usual "${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@" -# Try to shut down zinc explicitly -"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} +# check to see if zinc server is still running post-build +"${ZINC_BIN}" -status -port ${ZINC_PORT} &> /dev/null +ZINC_STATUS=$? + +# Try to shut down zinc explicitly if the server is still running +if [ $ZINC_STATUS -eq 0 ]; then + # zinc is still running! + "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} + exit 0 +else + # zinc is not running! exit cleanly + exit 0 +fi From d38efe487cf4619aa62acb4c318f1723cfe645fb Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 26 Oct 2018 09:38:10 -0700 Subject: [PATCH 2/6] simplify and add lightness --- build/mvn | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/build/mvn b/build/mvn index 8b16d09a1ad17..8c90cf8091d31 100755 --- a/build/mvn +++ b/build/mvn @@ -166,16 +166,7 @@ echo "Using \`mvn\` from path: $MVN_BIN" 1>&2 # call the `mvn` command as usual "${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@" -# check to see if zinc server is still running post-build -"${ZINC_BIN}" -status -port ${ZINC_PORT} &> /dev/null -ZINC_STATUS=$? - -# Try to shut down zinc explicitly if the server is still running -if [ $ZINC_STATUS -eq 0 ]; then - # zinc is still running! - "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} - exit 0 -else - # zinc is not running! exit cleanly - exit 0 -fi +# Try to shut down zinc explicitly if the server is still running. if it's not running, +# it's timed out and we'll still need to exit the script w/a 0 to keep the build from +# failing. +"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} || true From d09f4c04477d6b18b7be438cd2409c58e8dff8ca Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 26 Oct 2018 09:39:50 -0700 Subject: [PATCH 3/6] add jira issue to the comment for future archaeology --- build/mvn | 1 + 1 file changed, 1 insertion(+) diff --git a/build/mvn b/build/mvn index 8c90cf8091d31..cf80b707a45e4 100755 --- a/build/mvn +++ b/build/mvn @@ -166,6 +166,7 @@ echo "Using \`mvn\` from path: $MVN_BIN" 1>&2 # call the `mvn` command as usual "${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@" +# SPARK-25854 # Try to shut down zinc explicitly if the server is still running. if it's not running, # it's timed out and we'll still need to exit the script w/a 0 to keep the build from # failing. From 627e7d8b488816b504ea07faf670ace9eae6a22d Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 26 Oct 2018 09:42:37 -0700 Subject: [PATCH 4/6] we should exit this script with the mvn exit code --- build/mvn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/mvn b/build/mvn index cf80b707a45e4..440d588e11651 100755 --- a/build/mvn +++ b/build/mvn @@ -165,9 +165,12 @@ echo "Using \`mvn\` from path: $MVN_BIN" 1>&2 # call the `mvn` command as usual "${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@" +MVN_RETCODE=$? # SPARK-25854 # Try to shut down zinc explicitly if the server is still running. if it's not running, # it's timed out and we'll still need to exit the script w/a 0 to keep the build from # failing. "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} || true + +exit $MVN_RETCODE From 45bb7b0ab97326a63eb894d752c2f57a38b7c3e7 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 26 Oct 2018 11:01:40 -0700 Subject: [PATCH 5/6] removing superfluous true --- build/mvn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/mvn b/build/mvn index 440d588e11651..36604aa855b2b 100755 --- a/build/mvn +++ b/build/mvn @@ -171,6 +171,6 @@ MVN_RETCODE=$? # Try to shut down zinc explicitly if the server is still running. if it's not running, # it's timed out and we'll still need to exit the script w/a 0 to keep the build from # failing. -"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} || true +"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} exit $MVN_RETCODE From 3d32b6165718371c002d1ab5d41f621fdc3f69f6 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 26 Oct 2018 11:03:58 -0700 Subject: [PATCH 6/6] updating comments --- build/mvn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/mvn b/build/mvn index 36604aa855b2b..3816993b4e5c8 100755 --- a/build/mvn +++ b/build/mvn @@ -164,13 +164,11 @@ export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"} echo "Using \`mvn\` from path: $MVN_BIN" 1>&2 # call the `mvn` command as usual +# SPARK-25854 "${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@" MVN_RETCODE=$? -# SPARK-25854 -# Try to shut down zinc explicitly if the server is still running. if it's not running, -# it's timed out and we'll still need to exit the script w/a 0 to keep the build from -# failing. +# Try to shut down zinc explicitly if the server is still running. "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} exit $MVN_RETCODE