[HUDI-8941] Stop spark context with proper exit code in HoodieStreamer#12742
Merged
wombatu-kun merged 4 commits intoapache:masterfrom Feb 12, 2025
Merged
[HUDI-8941] Stop spark context with proper exit code in HoodieStreamer#12742wombatu-kun merged 4 commits intoapache:masterfrom
wombatu-kun merged 4 commits intoapache:masterfrom
Conversation
yihua
reviewed
Feb 3, 2025
| throw e; | ||
| } finally { | ||
| jssc.stop(); | ||
| jssc.sc().stop(exitCode); |
Contributor
There was a problem hiding this comment.
Thanks for the improvement. It looks like this API is introduced in Spark 3.4, so it does not compile on Spark 3.3. Could you adapt your change on that?
Contributor
Author
|
@hudi-bot run azure |
Contributor
Author
|
@yihua have made the change to run with spark 3.3 as well. Can you please review now. |
Contributor
Author
|
@hudi-bot run azure |
Collaborator
wombatu-kun
approved these changes
Feb 12, 2025
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 8, 2025
apache#12742) (cherry picked from commit b658989)
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 9, 2025
apache#12742) (cherry picked from commit b658989)
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 15, 2025
apache#12742) (cherry picked from commit b658989)
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.
Change Logs
Currently in Hoodiestreamer,
jssc.stop();is being called which always stops the application with exit code 0 even in case of any exception is raised.With new spark versions, exit code can be passed while stopping spark context.
For reference : https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/SparkContext.scala#L2306
This PR enables spark context to shutdown with proper exit code
Impact
NA
Risk level (write none, low medium or high below)
NA
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
ticket number here and follow the instruction to make
changes to the website.
Contributor's checklist