Skip to content

Commit

Permalink
[hotfix][task] Rename SourceStreamTask.isFinished to wasStoppedExtern…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
rkhachatryan committed Feb 3, 2021
1 parent 07d8465 commit 0527a31
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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());
Expand Down Expand Up @@ -170,11 +170,11 @@ protected void processInput(MailboxDefaultAction.Controller controller) throws E
.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
Expand Down Expand Up @@ -205,7 +205,7 @@ protected void cancelTask() {

@Override
protected void finishTask() throws Exception {
isFinished = true;
wasStoppedExternally = true;
cancelTask();
}

Expand Down

0 comments on commit 0527a31

Please sign in to comment.