[ 
https://issues.apache.org/jira/browse/FLINK-9776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16535210#comment-16535210
 ] 

ASF GitHub Bot commented on FLINK-9776:
---------------------------------------

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

    https://github.com/apache/flink/pull/6275#discussion_r200737014
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java ---
    @@ -1563,7 +1573,7 @@ public void run() {
     
                                // log stack trace where the executing thread 
is stuck and
                                // interrupt the running thread periodically 
while it is still alive
    -                           while (executerThread.isAlive()) {
    +                           while (task.shouldInterruptOnCancel() && 
executerThread.isAlive()) {
    --- End diff --
    
    I think that an atomic boolean might be required. This check can pass, then 
we get interrupted, meanwhile the stream task might already go into the 
shutdown code and the interrupt might slip through?


> Interrupt TaskThread only while in User/Operator code
> -----------------------------------------------------
>
>                 Key: FLINK-9776
>                 URL: https://issues.apache.org/jira/browse/FLINK-9776
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime
>            Reporter: Stephan Ewen
>            Assignee: Stephan Ewen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.6.0
>
>
> Upon cancellation, the task thread is periodically interrupted.
> This helps to pull the thread out of blocking operations in the user code.
> Once the thread leaves the user code, the repeated interrupts may interfere 
> with the shutdown cleanup logic, causing confusing exceptions.
> We should stop sending the periodic interrupts once the thread leaves the 
> user code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to