-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25854][BUILD] fix build/mvn not to fail during Zinc server shutdown
#22854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2f0a91b
d38efe4
d09f4c0
627e7d8
45bb7b0
3d32b61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's very unlikely, but there is a chance that the zinc is timed out between we check its status and shut it down. Since zinc will be timed out eventually, we don't care too much about if we can shut it down successfully here.
So how about
"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} || true?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that i'm a couple cups of coffee in to my morning, i'm actually back to thinking that this might be the most elegant way of dealing w/this.
i'll update the PR to do just this, and include a comment describing why we're doing it.