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

[SPARK-42699][CONNECT] SparkConnectServer should make client and AM same exit code #40315

Closed
wants to merge 5 commits into from

Conversation

AngersZhuuuu
Copy link
Contributor

What changes were proposed in this pull request?

Since in #35594 we support pass a exit code to AM,
when SparkConnectServer exit with -1, need pass this to AM too.

Why are the changes needed?

Keep same exit code

Does this PR introduce any user-facing change?

No

How was this patch tested?

@AngersZhuuuu
Copy link
Contributor Author

ping @HyukjinKwon

/**
* Stop the underlying `SparkContext`.
*
* @since 2.0.0
*/
def stop(): Unit = {
sparkContext.stop()
def stop(exitCode: Int = 0): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

@AngersZhuuuu this is a breaking change. You will need to define two stop methods, one with the status code, and one without.

@HyukjinKwon HyukjinKwon changed the title [SPARK-42699][CONNECTOR] SparkConnectServer should make client and AM same exit code [SPARK-42699][CONNECT] SparkConnectServer should make client and AM same exit code Mar 7, 2023
/**
* Stop the underlying `SparkContext`.
*
* @since 2.0.0
*/
def stop(): Unit = {
sparkContext.stop()
def stop(exitCode: Int = 0): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the default value here?

@@ -736,13 +736,15 @@ class SparkSession private(
}
// scalastyle:on

def stop(): Unit = stop(0)

/**
* Stop the underlying `SparkContext`.
*
* @since 2.0.0
Copy link
Member

Choose a reason for hiding this comment

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

You should have the new docs for the one for exitCode with new @since

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about current?

@AngersZhuuuu
Copy link
Contributor Author

ping @HyukjinKwon

*
* @since 2.0.0
*/
def stop(): Unit = {
sparkContext.stop()
def stop(): Unit = stop(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is better to not change this line. This line builds on sparkContext.stop(). Even though the underlying implementation is SparkContext.stop(0), I think we'd better do not make that assumption that it will always be.

@AngersZhuuuu
Copy link
Contributor Author

@amaliujia Like current? also ping @HyukjinKwon

@amaliujia
Copy link
Contributor

LGTM

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jul 17, 2023
@github-actions github-actions bot closed this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants