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

Lock.obtain(timeout) behaves incorrectly for large timeouts

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: core/store
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Because timeout is a long, but internal values derived from timeout
      are ints, its possible to overflow those internal values into negative
      numbers and cause incorrect behavior.

      Spinoff from this thread:

      http://www.gossamer-threads.com/lists/lucene/java-user/54376

      1. LUCENE-1048.patch
        3 kB
        Michael McCandless

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Simple patch that fixes the bug. I also added static constant
        Lock.LOCK_OBTAIN_WAIT_FOREVER which if passed as the timeout causes
        obtain to keep trying forever. Will commit in a day or two.

        Show
        mikemccand Michael McCandless added a comment - Simple patch that fixes the bug. I also added static constant Lock.LOCK_OBTAIN_WAIT_FOREVER which if passed as the timeout causes obtain to keep trying forever. Will commit in a day or two.
        Hide
        mikemccand Michael McCandless added a comment -

        I just committed this. Thanks Nikolay!

        Show
        mikemccand Michael McCandless added a comment - I just committed this. Thanks Nikolay!

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            mikemccand Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development