Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Shubham21k
Copy link

@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
} 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
Author

@hudi-bot run azure

@Shubham21k
Copy link
Author

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

@Shubham21k
Copy link
Author

@hudi-bot run azure

@hudi-bot
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S PR with lines of changes in (10, 100]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants