Skip to content

Commit

Permalink
[FLINK-28942][network] Fix the deadlock bug when recycling readers fo…
Browse files Browse the repository at this point in the history
…r SortMergeResultPartition

This closes apache#20560.
  • Loading branch information
TanYuxin-tyx authored Aug 12, 2022
1 parent 7cf7158 commit f2fb6b2
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,20 @@ protected void releaseInternal() {
if (resultFile == null && fileWriter != null) {
fileWriter.releaseQuietly();
}
}

// delete the produced file only when no reader is reading now
readScheduler
.release()
.thenRun(
() -> {
synchronized (lock) {
if (resultFile != null) {
resultFile.deleteQuietly();
resultFile = null;
}
// delete the produced file only when no reader is reading now
readScheduler
.release()
.thenRun(
() -> {
synchronized (lock) {
if (resultFile != null) {
resultFile.deleteQuietly();
resultFile = null;
}
});
}
}
});
}

@Override
Expand Down

0 comments on commit f2fb6b2

Please sign in to comment.