-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-19549] Allow providing reason for stage/job cancelling #16887
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
Conversation
| */ | ||
| def cancelJob(jobId: Int) { | ||
| dagScheduler.cancelJob(jobId) | ||
| def cancelJob(jobId: Int, reason: String = "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually you need to define a new function with two parameters and keep the old one to maintain binary compatibility for the public APIs.
| * Cancel a job that is running or waiting in the queue. | ||
| */ | ||
| def cancelJob(jobId: Int): Unit = { | ||
| def cancelJob(jobId: Int, reason: String = ""): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internally can we use an Option rather than empty string?
|
LGTM pending Jenkins. |
| def cancelJob(jobId: Int) { | ||
| dagScheduler.cancelJob(jobId) | ||
| def cancelJob(jobId: Int, reason: String): Unit = { | ||
| dagScheduler.cancelJob(jobId, Some(reason)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Option(reason), Some(reason) will happily wrap a null.
|
Test build #72712 has finished for PR 16887 at commit
|
|
Test build #72716 has finished for PR 16887 at commit
|
|
Test build #72717 has finished for PR 16887 at commit
|
|
Merging in master! |
|
Test build #72713 has finished for PR 16887 at commit
|
|
retest this please |
## What changes were proposed in this pull request? This change add an optional argument to `SparkContext.cancelStage()` and `SparkContext.cancelJob()` functions, which allows the caller to provide exact reason for the cancellation. ## How was this patch tested? Adds unit test. Author: Ala Luszczak <ala@databricks.com> Closes apache#16887 from ala/cancel.
This change add an optional argument to `SparkContext.cancelStage()` and `SparkContext.cancelJob()` functions, which allows the caller to provide exact reason for the cancellation. Adds unit test. Author: Ala Luszczak <ala@databricks.com> Closes apache#16887 from ala/cancel.
What changes were proposed in this pull request?
This change add an optional argument to
SparkContext.cancelStage()andSparkContext.cancelJob()functions, which allows the caller to provide exact reason for the cancellation.How was this patch tested?
Adds unit test.