Skip to content

Commit

Permalink
[apache#1462] fix(server): Memory may leak when flushQueue is full (a…
Browse files Browse the repository at this point in the history
…pache#1463)

### What changes were proposed in this pull request?

Release the memory when a flush event is dropped.

### Why are the changes needed?

For [apache#1462](apache#1462)

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs.
  • Loading branch information
rickyma authored Jan 19, 2024
1 parent 6f538a7 commit 2bcaf9e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public DefaultFlushEventHandler(
public void handle(ShuffleDataFlushEvent event) {
if (!flushQueue.offer(event)) {
LOG.error("Flush queue is full, discard event: " + event);
// We need to release the memory when discarding the event
event.doCleanup();
ShuffleServerMetrics.counterTotalDroppedEventNum.inc();
} else {
ShuffleServerMetrics.gaugeEventQueueSize.inc();
}
Expand Down

0 comments on commit 2bcaf9e

Please sign in to comment.