Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4135#discussion_r26236001
  
    --- Diff: core/src/main/scala/org/apache/spark/TaskContextImpl.scala ---
    @@ -66,8 +66,21 @@ private[spark] class TaskContextImpl(
       /** Marks the task as completed and triggers the listeners. */
       private[spark] def markTaskCompleted(): Unit = {
         completed = true
    +    processCallBacks()
    +  }
    +
    +  /** Marks the task for interruption, i.e. cancellation. */
    +  private[spark] def markInterrupted(): Unit = {
    +    interrupted = true
    +    processCallBacks()
    --- End diff --
    
    I noticed that the old code did not process callbacks on interruption.  
What is the API contract here for markTaskCompleted and markInterrupted()?  Are 
they mutually-exclusive, e.g. a task can be marked as completed or interrupted, 
but never both?  I think that we should add assertions to determine if this is 
the case, since I'm worried that this change might lead to duplicate calling of 
callbacks if this assumption isn't true.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to