Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-14163

RateBasedBackPressure unnecessarily invokes a lock on the Guava RateLimiter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 3.11.3, 4.0
    • Component/s: Legacy/Core
    • Labels:

      Description

      o.a.c.net.RateBasedBackPressure#apply calls getRate() on the underlying Guava RateLimiter several times in quick succession (including as the argument to a non level checked log statement).

      Said getRate() method acquires a lock within RateLimiter, so just getting a local variable reference will remove several calls and thus several lock acquisitions.

        Attachments

        1. 14163.patch
          3 kB
          Nate McCall

          Activity

            People

            • Assignee:
              zznate Nate McCall
              Reporter:
              zznate Nate McCall
              Authors:
              Nate McCall
              Reviewers:
              Jason Brown
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: