You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by pn...@apache.org on 2021/02/03 19:53:06 UTC

[flink] 05/05: [hotfix][task] Rename SourceStreamTask.isFinished to wasStoppedExternally

This is an automated email from the ASF dual-hosted git repository.

pnowojski pushed a commit to branch release-1.12
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 62081af01e1799535abb8df284ec1e76a71b41f2
Author: Roman Khachatryan <kh...@gmail.com>
AuthorDate: Tue Feb 2 19:34:39 2021 +0100

    [hotfix][task] Rename SourceStreamTask.isFinished to wasStoppedExternally
---
 .../apache/flink/streaming/runtime/tasks/SourceStreamTask.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java
index 1017d5f..59ba2d4 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java
@@ -64,7 +64,7 @@ public class SourceStreamTask<
      * Indicates whether this Task was purposefully finished (by finishTask()), in this case we want
      * to ignore exceptions thrown after finishing, to ensure shutdown works smoothly.
      */
-    private volatile boolean isFinished = false;
+    private volatile boolean wasStoppedExternally = false;
 
     public SourceStreamTask(Environment env) throws Exception {
         this(env, new Object());
@@ -164,11 +164,11 @@ public class SourceStreamTask<
                                             .isPresent()) {
                                 mailboxProcessor.reportThrowable(
                                         new CancelTaskException(sourceThreadThrowable));
-                            } else if (!isFinished && sourceThreadThrowable != null) {
+                            } else if (!wasStoppedExternally && sourceThreadThrowable != null) {
                                 mailboxProcessor.reportThrowable(sourceThreadThrowable);
                             } else if (sourceThreadThrowable != null
                                     || isCanceled()
-                                    || isFinished) {
+                                    || wasStoppedExternally) {
                                 mailboxProcessor.allActionsCompleted();
                             } else {
                                 // this is a "true" end of input regardless of whether
@@ -199,7 +199,7 @@ public class SourceStreamTask<
 
     @Override
     protected void finishTask() throws Exception {
-        isFinished = true;
+        wasStoppedExternally = true;
         cancelTask();
     }