Skip to content
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

RATIS-2225. RaftClientRequest leak in RaftServerImpl. #1198

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

szetszwo
Copy link
Contributor

See RATIS-2225

//RaftServerImpl.submitClientRequestAsync
    try {
      assertLifeCycleState(LifeCycle.States.RUNNING);
    } catch (ServerNotReadyException e) {
      final RaftClientReply reply = newExceptionReply(request, e);
      requestRef.release();
      return CompletableFuture.completedFuture(reply);
    }

In the code above,

  • it may catch ServerNotReadyException when the server is shutting down.
  • It calls newExceptionReply which may throw another exception.

Then, requestRef.release() is not called.

Also, when a unchecked exception is thrown, it won't be logged.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for the fix, LGTM.

Currently running 10x10 test.

@szetszwo
Copy link
Contributor Author

Currently running 10x10 test.

I ran it earlier. This change cannot completely fix the problem. We also need RATIS-2184. Then, it seems very close.

@adoroszlai adoroszlai merged commit 0514e09 into apache:master Dec 23, 2024
12 checks passed
@szetszwo
Copy link
Contributor Author

@adoroszlai , thanks a lot for reviewing and merging this!

@szetszwo
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants