RATIS-2512. Fix unreleased zero-copy messages during gRPC service shutdown.#1445
RATIS-2512. Fix unreleased zero-copy messages during gRPC service shutdown.#1445slfan1989 wants to merge 1 commit into
Conversation
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
| } | ||
|
|
||
| void close() { | ||
| zeroCopyRequestMarshaller.close(); |
There was a problem hiding this comment.
This is good catch! We never call zeroCopyRequestMarshaller.close() except for tests.
|
This PR has been marked as stale due to 60 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in ~30 days. |
|
@szetszwo I think this is good to merge as well? @slfan1989 could you please address the test failures in CI? |
|
@spacemonkd , we need to wait for passing all the tests. |
|
Yup, let's wait for @slfan1989 to address the test failures |
Thanks @spacemonkd and @szetszwo. Since this PR is based on the old Some parts of the old branch have diverged significantly from After the new branch is ready, I will reapply the RATIS-2512 fix there, rerun the relevant tests against the current codebase, and open a replacement PR. The migration approach is being discussed here: https://lists.apache.org/thread/n9h35mvqor5dl8vpdfnngvqjwl5bx133 I would appreciate your thoughts on whether this approach sounds reasonable before I proceed. Thanks! cc: @adoroszlai |
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?