Commit 5bdaa72
### What changes were proposed in this pull request?
This PR aims to use `0` as the exit code for `--help` usage 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 `0` when `--help` is given because `--help` argument is not a error case.
**SparkSubmit**
https://github.com/apache/spark/blob/d5da49d56d7dec5f8a96c5252384d865f7efd4d9/core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala#L458-L459
**Spark Master**
https://github.com/apache/spark/blob/d5da49d56d7dec5f8a96c5252384d865f7efd4d9/core/src/main/scala/org/apache/spark/deploy/master/MasterArguments.scala#L88-L89
**Spark Worker**
https://github.com/apache/spark/blob/d5da49d56d7dec5f8a96c5252384d865f7efd4d9/core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala#L107-L108
**Spark History Server**
https://github.com/apache/spark/blob/d5da49d56d7dec5f8a96c5252384d865f7efd4d9/core/src/main/scala/org/apache/spark/deploy/history/HistoryServerArguments.scala#L39-L40
In addition, all scripts under `bin/*` return `0` consistently like the following. This PR changes `sbin/*` scripts additionally for consistency.
| Command | Before | After |
| ---------- | ------- | ------- |
| bin/spark-class --help | 0 | 0 |
| bin/spark-shell --help | 0 | 0 |
| bin/pyspark --help | 0 | 0 |
| bin/spark-sql --help | 0 | 0 |
| bin/beeline --help | 0 | 0 |
| bin/sparkR --help | 0 | 0 |
| bin/docker-image-tool.sh --help | 0 | 0 |
| sbin/start-master.sh --help | 1 | 0 |
| sbin/start-worker.sh --help | 1 | 0 |
| sbin/start-history-server.sh --help | 1 | 0 |
| sbin/start-thriftserver.sh --help | 1 | 0 |
| sbin/start-connect-server.sh --help | 1 | 0 |
### Does this PR introduce _any_ user-facing change?
Yes, but this is a exit status code for `--help` or `-h`.
### How was this patch tested?
Manual review.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #48939 from dongjoon-hyun/SPARK-50398.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
1 parent d5da49d commit 5bdaa72
File tree
5 files changed
+5
-5
lines changed- sbin
5 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
0 commit comments