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

Improve RateLimiters Initialization semantics

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.10.3, 5.0, 6.0
    • None
    • None
    • 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

        1. LUCENE-5948.patch
          1 kB
          Varun Thacker

        Issue Links

          Activity

            People

              rcmuir Robert Muir
              varun Varun Thacker
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: