[SPARK-50398][CORE] Use ExitCode 0 for --help usage in Spark scripts
#48939
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR aims to use
0as the exit code for--helpusage in Spark scripts consistently to provide better and consistent UX from Apache Spark 4.0.0.Why are the changes needed?
Initially, Apache Spark was designed to exit with
0when--helpis given because--helpargument is not a error case.SparkSubmit
spark/core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala
Lines 458 to 459 in d5da49d
Spark Master
spark/core/src/main/scala/org/apache/spark/deploy/master/MasterArguments.scala
Lines 88 to 89 in d5da49d
Spark Worker
spark/core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala
Lines 107 to 108 in d5da49d
Spark History Server
spark/core/src/main/scala/org/apache/spark/deploy/history/HistoryServerArguments.scala
Lines 39 to 40 in d5da49d
In addition, all scripts under
bin/*return0consistently like the following. This PR changessbin/*scripts additionally for consistency.Does this PR introduce any user-facing change?
Yes, but this is a exit status code for
--helpor-h.How was this patch tested?
Manual review.
Was this patch authored or co-authored using generative AI tooling?
No.