kezhuw commented on a change in pull request #15425:
URL: https://github.com/apache/flink/pull/15425#discussion_r604637663



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceOperatorStreamTask.java
##########
@@ -97,6 +97,11 @@ public void init() throws Exception {
         inputProcessor = new StreamOneInputProcessor<>(input, output, 
operatorChain);
     }
 
+    @Override
+    protected void finishTask() throws Exception {
+        stopMailboxProcessor();

Review comment:
       @becketqin I raised similar concern in FLINK-21821 😄 . Here is thoughts 
from my side after digging history a bit. Normal shutdown runs `afterInvoke`, 
`cleanUpInvoke` in order. `cancel` is responsible for abnormal path, which 
includes:
   
   * User don't want a normal shutdown in willing.
   * User has to do this due to stuck in normal shutdown.
   
   In the later path, this `cancelables.close` and other closing 
operations(`TaskCanceler.networkResourcesCloser`) in cancel path plays crucial 
role to break possible stuck.
   
   There might be other concerns such as fast shutdown of background activities 
though.
   
   Anyway,`cancel` has to deal with un-happy paths.




-- 
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]


Reply via email to