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

Resolve a potential dead lock in ParallelGatewaySenderQueue

    XMLWordPrintableJSON

    Details

      Description

      When brq is created but encountered a failed GII, enqueue to it could have a potential deadlock:

      Thread-1:
      ParallelGatewaySenderQueue.put() will get a brq.getInitializationLock().readLock().lock() (lock-A’s read lock). Then during the put operation, it will try to call lockWhenRegionIsInitializing() to get failedInitialImageLock.readLock().lock (lock-B’s read lock)

      Thread-2:
      PRDS.createBucketRegion() will trigger GII but failed. So it will call cleanUpAfterFailedGII(), where it will call lockFailedInitialImageWriteLock
      () to get lock-B’s write lock first. Then call BucketRegionQueue.clearEntries().
      It will call getInitializationLock().writeLock().lock() (lock-A’s write lock).

      To fix it, we need to let thread-1 to get failedInitialImageLock.readLock() (lock-B) before requesting lock-A.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zhouxj Xiaojian Zhou
                Reporter:
                zhouxj Xiaojian Zhou
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: