Skip to content

Commit b67f472

Browse files
committed
Add comment on why interruptOnCancel is in setJobGroup
1 parent 4cb9fd6 commit b67f472

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ class SparkContext(config: SparkConf) extends Logging {
390390
def setJobGroup(groupId: String, description: String, interruptOnCancel: Boolean = false) {
391391
setLocalProperty(SparkContext.SPARK_JOB_DESCRIPTION, description)
392392
setLocalProperty(SparkContext.SPARK_JOB_GROUP_ID, groupId)
393+
// Note: Specifying interruptOnCancel in setJobGroup (rather than cancelJobGroup) avoids
394+
// changing several public APIs and allows Spark cancellations outside of the cancelJobGroup
395+
// APIs to also take advantage of this property (e.g., internal job failures or canceling from
396+
// JobProgressTab UI) on a per-job basis.
393397
setLocalProperty(SparkContext.SPARK_JOB_INTERRUPT_ON_CANCEL, interruptOnCancel.toString)
394398
}
395399

0 commit comments

Comments
 (0)