XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.1.0
    • server
    • None

    Description

      Found this bug when working on adding assertions to ensure all zero-copy buffers are released in tests (RATIS-1978).

      When client connections are terminated, the `whenComplete` promise seems not executed. This leads to unreleased zero-copy buffers. For example, the whenComplete block as below may not be executed when clients time out. 

      // In RaftServerImpl
      @Override
      public CompletableFuture<RaftClientReply> submitClientRequestAsync(
          ReferenceCountedObject<RaftClientRequest> requestRef) {
        final RaftClientRequest request = requestRef.retain();
        ...
        return replyFuture(requestRef).whenComplete((clientReply, exception) -> {
        requestRef.release();
        timerContext.ifPresent(Timekeeper.Context::stop);
        if (exception != null || clientReply.getException() != null) {
          raftServerMetrics.incFailedRequestCount(request.getType());
        }
      }); 

      Attachments

        Issue Links

          Activity

            People

              duongnguyen Duong
              duongnguyen Duong
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m