Skip to content

Commit

Permalink
fix read write request leak when executor full. (apache#4024)
Browse files Browse the repository at this point in the history
Co-authored-by: wangjinlong <wangjinlong@zhihu.com>
  • Loading branch information
2 people authored and Anup Ghatage committed Jul 12, 2024
1 parent 0b5ec71 commit 345c027
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,9 @@ private void processAddRequest(final BookieProtocol.ParsedAddRequest r, final Bo
BookieProtocol.ETOOMANYREQUESTS,
ResponseBuilder.buildErrorResponse(BookieProtocol.ETOOMANYREQUESTS, r),
requestStats.getAddRequestStats());
r.release();
r.recycle();
write.recycle();
}
}
}
Expand Down Expand Up @@ -703,6 +706,7 @@ private void processReadRequest(final BookieProtocol.ReadRequest r, final Bookie
ResponseBuilder.buildErrorResponse(BookieProtocol.ETOOMANYREQUESTS, r),
requestStats.getReadRequestStats());
onReadRequestFinish();
read.recycle();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public String toString() {
return String.format("ReadEntry(%d, %d)", request.getLedgerId(), request.getEntryId());
}

private void recycle() {
void recycle() {
request.recycle();
super.reset();
this.recyclerHandle.recycle(this);
Expand Down

0 comments on commit 345c027

Please sign in to comment.