Skip to content

Comments

[SPARK-42950][CORE] Add exit code in SparkListenerApplicationEnd#40591

Closed
paul-laffon-dd wants to merge 1 commit intoapache:masterfrom
paul-laffon-dd:spark-42950
Closed

[SPARK-42950][CORE] Add exit code in SparkListenerApplicationEnd#40591
paul-laffon-dd wants to merge 1 commit intoapache:masterfrom
paul-laffon-dd:spark-42950

Conversation

@paul-laffon-dd
Copy link

What changes were proposed in this pull request?

The exit code is already available in the stop(exitCode: Int) function of the SparkContext, it only can be propagated to the event SparkListenerApplicationEnd that is emitted in the postApplicationEnd

Using an Option[Int] to reflect that the exit code can be missing if reading an event log of a previous version of spark

Why are the changes needed?

Being able to know if a spark application succeeded or failed when using the spark listener API

Does this PR introduce any user-facing change?

Yes, adding a new field exitCode to SparkListenerApplicationEnd, which is marked as @DeveloperApi

How was this patch tested?

Updated the unit tests to make sure the value is correctly propagated

Launched a spark application from this branch, and looking at the last emitted event

{"Event":"SparkListenerApplicationEnd","Timestamp":1680108841738,"Exit Code":0}


@DeveloperApi
case class SparkListenerApplicationEnd(time: Long) extends SparkListenerEvent
case class SparkListenerApplicationEnd(time: Long, exitCode: Option[Int] = None)
Copy link
Member

Choose a reason for hiding this comment

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

we'll have to define another constructor instead of using default value which breaks binary compat (and +source compat if you use Java)

@github-actions
Copy link

github-actions bot commented Jul 9, 2023

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 9, 2023
@github-actions github-actions bot closed this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants