kl0u commented on a change in pull request #9090: [FLINK-13124] Don't forward 
exceptions when finishing SourceStreamTask
URL: https://github.com/apache/flink/pull/9090#discussion_r302887952
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java
 ##########
 @@ -147,6 +155,7 @@ protected void cancelTask() {
 
        @Override
 
 Review comment:
   With the above comments in mind, I would suggest to have a method in the 
`StreamTask` like the following:
   
   ```
   @VisibleForTesting
    void finish() throws Exception {
                finished = true;
                finishTask(); // this is implemented by subclasses
        }
   ```
   (needed in the `finishingIgnoresExceptions()` test).
   
   And with this, the end of the `performCheckpoint` should become:
   
   ```
   if (isRunning && syncSavepointLatch.isSet()) {
   
                        final boolean checkpointWasAcked =
                                        
syncSavepointLatch.blockUntilCheckpointIsAcknowledged();
   
                        if (checkpointWasAcked) {
                                finishTask();
                        }
                }
   ```

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