Skip to content

Commit

Permalink
fix getLocalShuffleIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengchenyu committed Aug 17, 2023
1 parent fe28c86 commit f12143c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ public long getDataFileLen() {
public boolean isEmpty() {
return buffer == null || buffer.size() == 0;
}

public void release() {
if (this.buffer != null) {
this.buffer.release();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,10 @@ public void getLocalShuffleIndex(
.getShuffleServerConf()
.getLong(ShuffleServerConf.SERVER_SHUFFLE_INDEX_SIZE_HINT);
if (shuffleServer.getShuffleBufferManager().requireReadMemoryWithRetry(assumedFileSize)) {
ShuffleIndexResult shuffleIndexResult = null;
try {
long start = System.currentTimeMillis();
ShuffleIndexResult shuffleIndexResult =
shuffleIndexResult =
shuffleServer
.getShuffleTaskManager()
.getShuffleIndex(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum);
Expand Down Expand Up @@ -747,6 +748,9 @@ public void getLocalShuffleIndex(
.setRetMsg(msg)
.build();
} finally {
if (shuffleIndexResult != null) {
shuffleIndexResult.release();
}
shuffleServer.getShuffleBufferManager().releaseReadMemory(assumedFileSize);
}
} else {
Expand Down

0 comments on commit f12143c

Please sign in to comment.