RATIS-2512. Fix unreleased zero-copy messages during gRPC service shutdown.#1445
Open
slfan1989 wants to merge 1 commit intoapache:RATIS-1931_grpc-zero-copyfrom
Open
RATIS-2512. Fix unreleased zero-copy messages during gRPC service shutdown.#1445slfan1989 wants to merge 1 commit intoapache:RATIS-1931_grpc-zero-copyfrom
slfan1989 wants to merge 1 commit intoapache:RATIS-1931_grpc-zero-copyfrom
Conversation
szetszwo
reviewed
May 5, 2026
Contributor
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
| } | ||
|
|
||
| void close() { | ||
| zeroCopyRequestMarshaller.close(); |
Contributor
There was a problem hiding this comment.
This is good catch! We never call zeroCopyRequestMarshaller.close() except for tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This pull request fixes a zero-copy request leak during gRPC service shutdown.
ZeroCopyMessageMarshallermay still hold pending or in-flight zero-copy request streams when the gRPC service is being closed. Previously, closing these tracked streams did not trigger the release logic for the corresponding zero-copy messages, which could causeZeroCopyMetricsto report unreleased messages during cluster shutdown.The proposed changes:
ZeroCopyMessageMarshaller.close()is called.GrpcServicesImpl.closeImpl()before unregistering zero-copy metrics.GrpcServerProtocolServiceinstance bound to the gRPC server is also closed during shutdown.What is the link to the Apache JIRA
RATIS-2512. Fix unreleased zero-copy messages during gRPC service shutdown
How was this patch tested?