Skip to content

Commit

Permalink
Fix memory leak when the Bookie is in read-only mode. (#3746)
Browse files Browse the repository at this point in the history
Descriptions of the changes in this PR:
Fixes #3745

(cherry picked from commit af82d14)
  • Loading branch information
horizonzy authored and zymap committed Feb 16, 2023
1 parent f92171f commit fcff85b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public Object decode(ByteBuf packet)
packet.markReaderIndex();
return BookieProtocol.ParsedAddRequest.create(
version, ledgerId, entryId, flags,
masterKey, packet.retain());
masterKey, packet);
}

case BookieProtocol.READENTRY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ public void safeRun() {
if (request instanceof BookieProtocol.ReadRequest) {
requestProcessor.onReadRequestFinish();
}
if (request instanceof BookieProtocol.AddRequest) {
if (request instanceof BookieProtocol.ParsedAddRequest) {
((BookieProtocol.ParsedAddRequest) request).release();
request.recycle();
requestProcessor.onAddRequestFinish();
}
return;
Expand Down

0 comments on commit fcff85b

Please sign in to comment.