Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-678

DistributedLockService: reentrant lock calls with a small wait time can cause the lock to be lost

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0-incubating.M1
    • core
    • None

    Description

      If a thread already holds a lock from the DistributedLockService (this also applies to global regions and using Region.getDistributedLock) then it can reenter the lock by acquiring it again by calling lock. Since the thread already holds the lock it does not need to wait to acquire it. But if a very small waitTIme parameter is passed then the implementation may timeout the reacquire call telling the caller that it could not acquire the lock.

      In this case the thread also loses the original lock it held and future attempts to release it will fail with LockNotHeldException.

      The waitTime should only be considered in the initial lock request when you might be waiting for some other thread to release the lock. If you already hold the lock then waitTime should be ignored.

      Attachments

        Activity

          People

            dschneider Darrel Schneider
            dschneider Darrel Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: