Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: core/other
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      33799

      Description

      In org.apache.lucene.store.Lock, line 57 (lucene_1_4_final branch):

      if (++sleepCount == maxSleepCount)

      is incorrect, the sleepCount is incremented before the compare causing it
      throwing the exception with out waiting for at least 1 interation.

      Should be changed instead to:
      if (sleepCount++ == maxSleepCount)

      As this is a self-contained simple fix, I am not submitting a patch.

      Thanks

      -John

        Activity

        Hide
        daniel.naber@t-online.de Daniel Naber added a comment -

        You're right, the Lock.obtain(long) method never actually waits when using the
        default settings. Does anyone know of a reason why this should not be fixed?

        Show
        daniel.naber@t-online.de Daniel Naber added a comment - You're right, the Lock.obtain(long) method never actually waits when using the default settings. Does anyone know of a reason why this should not be fixed?
        Hide
        daniel.naber@t-online.de Daniel Naber added a comment -

        This is fixed now in SVN.

        Show
        daniel.naber@t-online.de Daniel Naber added a comment - This is fixed now in SVN.
        Hide
        dkrzemin pirxpilot added a comment -

        Did not realize it was fixed already. Just in case if someone wants to check it in: this is a unit test that shows original problem.

        Show
        dkrzemin pirxpilot added a comment - Did not realize it was fixed already. Just in case if someone wants to check it in: this is a unit test that shows original problem.

          People

          • Assignee:
            java-dev@lucene.apache.org Lucene Developers
            Reporter:
            john.wang@gmail.com John Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development