-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Pass Spark job server JVM args #39242
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 all commits
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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "trigger-2026-04-04": "portable_runner expand_sdf opt-in" | ||
| "trigger-2026-07-08": "portable_runner expand_sdf opt-in 2" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ Options: | |
| --job_port [port for job endpoint, default 8099] | ||
| --artifact_port [port for artifact service, default 8098] | ||
| --job_server_jar [path to job server jar] | ||
| --jvm_args [additional JVM arguments, e.g. --add-opens flags] | ||
| END | ||
|
|
||
| JOB_PORT=8099 | ||
|
|
@@ -61,6 +62,11 @@ while [[ $# -gt 0 ]]; do | |
| shift | ||
| shift | ||
| ;; | ||
| --jvm_args) | ||
| JVM_ARGS="$2" | ||
| shift | ||
| shift | ||
| ;; | ||
| start) | ||
| STARTSTOP="$1" | ||
| shift | ||
|
|
@@ -107,7 +113,7 @@ case $STARTSTOP in | |
| fi | ||
|
|
||
| echo "Launching job server @ $JOB_PORT ..." | ||
| "$JAVA_CMD" -jar $JOB_SERVER_JAR --job-port=$JOB_PORT --artifact-port=$ARTIFACT_PORT --expansion-port=0 $ADDITIONAL_ARGS >$TEMP_DIR/$FILE_BASE.log 2>&1 </dev/null & | ||
| "$JAVA_CMD" $JVM_ARGS -jar $JOB_SERVER_JAR --job-port=$JOB_PORT --artifact-port=$ARTIFACT_PORT --expansion-port=0 $ADDITIONAL_ARGS >$TEMP_DIR/$FILE_BASE.log 2>&1 </dev/null & | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When To ensure robustness and avoid issues with empty values, it is safer to use an array for arguments in bash, or explicitly handle the expansion. Since this script is executed via |
||
| mypid=$! | ||
| if kill -0 $mypid >/dev/null 2>&1; then | ||
| echo $mypid >> $pid | ||
|
|
||
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.
In Groovy/Gradle, using
as inton a property that might be a String can throw aNumberFormatExceptionif the property is not a valid integer. Additionally,JavaVersion.current().majorVersionis already a String, so calling.toInteger()on it is safe, but we should make suretestJavaVersionis safely parsed.Consider using
Integer.parseInt()or a safe cast with a fallback to avoid potential build failures iftestJavaVersionis configured incorrectly.