Aitozi commented on a change in pull request #8692: [FLINK-12804] Introduce 
mailbox-based ExecutorService
URL: https://github.com/apache/flink/pull/8692#discussion_r294071138
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
 ##########
 @@ -462,12 +486,20 @@ public final void invoke() throws Exception {
                                        operatorChain.releaseOutputs();
                                }
                        }
+
+                       // close mailbox
+                       
FutureUtils.cancelRunnableFutures(taskMailboxExecutor.shutdownNow());
                }
        }
 
        @Override
        public final void cancel() throws Exception {
-               mailbox.clearAndPut(POISON_LETTER);
+               try {
+                       List<Runnable> droppedRunnables = 
taskMailboxExecutor.getMailbox().clearAndPut(mailboxPoisonLetter);
+                       FutureUtils.cancelRunnableFutures(droppedRunnables);
 
 Review comment:
   At the moment the pending letters are not under real execution although they 
may be a future instance, why needs to do the cancel operation on them ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to