Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1831

GrpcLogAppender spinning idle between heartbeats

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0, 2.5.0
    • 3.0.0, 2.5.1
    • gRPC
    • None

    Description

        public long getWaitTimeMs() {
          if (haveTooManyPendingRequests()) {
            return getHeartbeatWaitTimeMs(); // Should wait for a short time
          } else if (shouldSendAppendEntries() && !isSlowFollower()) {
            // For normal nodes, new entries should be sent ASAP
            // however for slow followers (especially when the follower is down),
            // keep sending without any wait time only ends up in high CPU load
            return Math.max(getMinWaitTimeMs(), 0L);
          }
          return Math.min(getMinWaitTimeMs(), getHeartbeatWaitTimeMs());
        }
      

      GrpcLogAppender's main loop does not wait if there is nothing to be sent or follower is slow (last return in getWaitTimeMs):

      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(10, 72) -> 10
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(0, 61) -> 0
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 61) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 61) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 61) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 61) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 61) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-1, 60) -> -1
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 60) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-2, 59) -> -2
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 59) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 59) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 59) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      (GrpcLogAppender.java:getWaitTimeMs(187)) - s2@group-6BFAB8E011F7->s0-GrpcLogAppender: wait min(-3, 58) -> -3
      

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              1 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