[ 
https://issues.apache.org/jira/browse/SPARK-56330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon resolved SPARK-56330.
----------------------------------
    Fix Version/s: 4.2.0
       Resolution: Fixed

Issue resolved by pull request 55151
[https://github.com/apache/spark/pull/55151]

> Add TaskInterruptListener to TaskContext for interrupt notifications
> --------------------------------------------------------------------
>
>                 Key: SPARK-56330
>                 URL: https://issues.apache.org/jira/browse/SPARK-56330
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 4.2.0
>         Environment: Spark implements task cancellation via polling. Code 
> must call TaskContext#killTaskIfInterrupted() periodically to check whether 
> the current task has been cancelled and abort if so. This works well for 
> simple iterator loops, but has two limitations:
> {*}- No push notification{*}: There is no way to register a callback that 
> fires immediately when a task is interrupted. This precludes patterns like 
> atomically setting a flag (to make future polls cheaper) or waking up a 
> thread blocked on I/O or a lock.
> {*}- No immediate reaction{*}: If a component wants to react to cancellation 
> outside of its hasNext() loop (e.g., to unblock a waiting thread), it must 
> rely on a separate polling mechanism.       
> Additionally, TaskKilledException does not pass the reason string to the 
> RuntimeException constructor, so getMessage() returns null instead of the 
> cancellation reason.
>            Reporter: Ivan Sadikov
>            Assignee: Ivan Sadikov
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.2.0
>
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to