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

SimpleRateLimiter cast overflow results in Thread.sleep exception

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.10.3, 5.0, 6.0
    • core/store
    • None
    • New

    Description

      SimpleRateLimiter.pause() uses an uncheck cast of longs to ints:

      Thread.sleep((int) (pauseNS/1000000), (int) (pauseNS % 1000000));

      Although we check that pauseNS is positive, however if it's large enough the cast to int produces a negative value, causing Thread.sleep to throw an exception.

      We should protect for it.

      Attachments

        1. LUCENE-6075.patch
          3 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            bleskes Boaz Leskes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: