You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/07/17 09:46:20 UTC

[GitHub] [flink] 1u0 commented on a change in pull request #9125: [FLINK-13275] Fix race condition in finishTask().

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, 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:
users@infra.apache.org


With regards,
Apache Git Services