Skip to content

[HUDI-8941] Stop spark context with proper exit code in HoodieStreamer#12742

Merged
wombatu-kun merged 4 commits intoapache:masterfrom
Shubham21k:hoodie_streamer_exitcode
Feb 12, 2025
Merged

[HUDI-8941] Stop spark context with proper exit code in HoodieStreamer#12742
wombatu-kun merged 4 commits intoapache:masterfrom
Shubham21k:hoodie_streamer_exitcode

Conversation

@Shubham21k
Copy link
Contributor

@Shubham21k Shubham21k commented Jan 30, 2025

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".

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:XS PR with lines of changes in <= 10 label Jan 30, 2025
throw e;
} finally {
jssc.stop();
jssc.sc().stop(exitCode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@github-actions github-actions bot added size:S PR with lines of changes in (10, 100] and removed size:XS PR with lines of changes in <= 10 labels Feb 4, 2025
@Shubham21k
Copy link
Contributor Author

@hudi-bot run azure

@Shubham21k
Copy link
Contributor Author

@yihua have made the change to run with spark 3.3 as well. Can you please review now.

@Shubham21k
Copy link
Contributor Author

@hudi-bot run azure

@hudi-bot
Copy link
Collaborator

hudi-bot commented Feb 5, 2025

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Copy link
Contributor

@prathit06 prathit06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Shubham21k Shubham21k requested a review from yihua February 6, 2025 18:06
@wombatu-kun wombatu-kun merged commit b658989 into apache:master Feb 12, 2025
43 checks passed
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 8, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 9, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0.2 size:S PR with lines of changes in (10, 100]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants