-
Notifications
You must be signed in to change notification settings - Fork 438
RATIS-2007. Zero-copy buffers are not released #1027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@szetszwo Please have a look. |
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duongkame , thanks for working on this! Just have a comment inlined.
| final RaftClientReply reply = newExceptionReply(request, e); | ||
| requestRef.release(); | ||
| final RaftClientReply reply = newExceptionReply(request, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original order (newExceptionReply -> release) seems better since request is used in newExceptionReply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I made that change my mistake.
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 the change looks good.
What changes were proposed in this pull request?
When running tests as per #1023, some buffer leaks are discovered.
ReferenceCountedObjectreleaseinwhenComplete(e.g.RaftServerImpl'ssubmitClientRequestAsyncandappendEntriesAsync) does not always guarantee an execution. As the retuned future may be discarded when the client connection is terminated.processClientRequestcalled from SlidingWindow doesn't always guarantee 100% execution either.PendingOrderedRequestentries may not be processed at all because of client cancellation, or request duplications (IllegalStateExceptiondue to retries.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2007
How was this patch tested?
Tests.