[SPARK-58536] Fix stale docstring for getDefaultFinalStatus in cluster mode - #57736
Open
Lobo2008 wants to merge 2 commits into
Open
[SPARK-58536] Fix stale docstring for getDefaultFinalStatus in cluster mode#57736Lobo2008 wants to merge 2 commits into
Lobo2008 wants to merge 2 commits into
Conversation
…r mode The docstring for getDefaultFinalStatus() says it should return SUCCEEDED in cluster mode 'to handle if the user calls System.exit from the application code', but the implementation returns FAILED. This causes applications that exit normally via System.exit(0) in cluster mode to report FAILED to YARN RM when the shutdown hook fires before finish(SUCCEEDED) is reached. Fix the implementation to match the documented behavior.
uros-b
requested changes
Aug 4, 2026
| final def getDefaultFinalStatus(): FinalApplicationStatus = { | ||
| if (isClusterMode) { | ||
| FinalApplicationStatus.FAILED | ||
| FinalApplicationStatus.SUCCEEDED |
Member
There was a problem hiding this comment.
This inverts a FAIL-SAFE default, and the justification rests on a STALE docstring rather than the code's intent. The FAILED default was set deliberately in SPARK-38270; the docstring mentioning SUCCEEDED predates that change and was not updated. The real defect is the comment, not the code. This PR resolves the mismatch in the wrong direction.
Author
There was a problem hiding this comment.
@uros-b Thanks for the review! You're right — SPARK-38270 intentionally changed this
to FAILED. I've updated the PR to fix the stale docstring instead of the code.
…r mode SPARK-38270 changed getDefaultFinalStatus() to return FAILED for cluster mode, but the docstring was not updated and still says SUCCEEDED. Fix the docstring to match the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Fix the stale docstring of
getDefaultFinalStatus()to match thecurrent implementation. The method returns
FAILEDfor cluster modesince SPARK-38270, but the docstring was never updated.
Why are the changes needed?
SPARK-38270 deliberately changed the default to
FAILEDto ensurethat the shutdown hook does not incorrectly report
SUCCEEDEDwhenthe application exits with a non-zero exit code. However, the
docstring still says
SUCCEEDED, which is misleading.Does this PR introduce any user-facing change?
No. Doc-only change.
How was this patch tested?
Doc-only change.