Skip to content

Commit

Permalink
[hotfix][network] Simplify SingleInputGate#isFinished
Browse files Browse the repository at this point in the history
Previous implementation of #isFinished was not only checking whether the input gate is finished, but also if it was
closed. This commit simplifies #isFinished to just check whether the input gate is finished. The only difference is that
the following scenario:

inputGate.close()
inputGate.isFinished() (2)

before this change (2) would return true, now it will return false. This potentially could be
relevant, because TaskCanceller is calling InputGate#close, however it doesn't relay on #isFinished().

Any InputGate's user after accessing InputGate#get/pollNextBufferOrEvent would still get an
IllegalStateException("Released") both before and after this change, so changing/simplifying #isFinished()
implementation from "isFinishedOrClosed()" as it was before to just "isFinished()" shouldn't matter.
  • Loading branch information
pnowojski committed Jun 5, 2019
1 parent f35b1a3 commit d118517
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,7 @@ public void close() throws IOException {

@Override
public boolean isFinished() {
synchronized (requestLock) {
for (InputChannel inputChannel : inputChannels.values()) {
if (!inputChannel.isReleased()) {
return false;
}
}
}

return true;
return hasReceivedAllEndOfPartitionEvents;
}

@Override
Expand Down

0 comments on commit d118517

Please sign in to comment.