Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5948

Improve RateLimiters Initialization semantics

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.10.3, 5.0, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I was working on SOLR-6485 when I realized that the first time pause is called even if we write a lot of bytes pause doesn't work correctly because in SimpleRateLimiter.pause() lastNS is 0 and startNS is always more than targetNS.

      If we remove the following line from TestRateLimiter.testPause() then the test fails -

      limiter.pause(2);//init
      

      Should we do one of the following ?
      1. Initialize lastNS in the ctor

      lastNS = System.nanoTime();

      2. Add a method saying start() which does the same

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rcmuir Robert Muir
                Reporter:
                varunthacker Varun Thacker
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: