1u0 commented on a change in pull request #9125: [FLINK-13275] Fix race 
condition in finishTask().
URL: https://github.com/apache/flink/pull/9125#discussion_r304312547
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java
 ##########
 @@ -110,7 +116,12 @@ protected void performDefaultAction(DefaultActionContext 
context) throws Excepti
                final LegacySourceFunctionThread sourceThread = new 
LegacySourceFunctionThread(getName());
                sourceThread.start();
                sourceThread.getCompletionFuture().whenComplete((Void ignore, 
Throwable sourceThreadThrowable) -> {
-                       if (sourceThreadThrowable == null) {
+                       if (sourceThreadThrowable == null || isFinished) {
+
+                               // the isFinished is only set in the case of 
SYNC_SAVEPOINT. In this case, the final savepoint is
+                               // already completed, so we do not risk the 
POISON_PILL to overpass the savepoint barrier and lead
+                               // to a deadlock.
 
 Review comment:
   Personally, I'd remove this comment block, as it may be irrelevant or become 
outdated.
   The comment near the `isFinished` field already has some explanation wrt 
exceptions.

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