Uploaded image for project: 'Giraph'
  1. Giraph
  2. GIRAPH-734

DiskBackedPartitionStore attempting to release a lock it doesn't own

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 1.1.0
    • Fix Version/s: 1.1.0
    • Component/s: graph
    • Labels:
      None

      Description

      Within the DiskBackedPartitionStore.GetPartition and DiskBackedPartitionStore.AddPartition classes call() method there is a pattern whereby the write lock is temporarily released and re-acquired to allow some offload/load methods to be called without the lock. I ran into a situation where the offload method threw an exception which caused the outer finally which releases the write lock to fire, however it hadn't re-acquired the lock so IllegalMonitorStateException is thrown, masking the original exception.

      I believe this nested offload/load logic either needs to be in a try/finally of its own where it re-aquires the lock in the finally, or the outer finally's unlock needs to be guarded with lock.isWriteLockedByCurrentThread().

      To reproduce this issue, simply put an older version of guava (like 11) into the classpath before the version that giraph needs (12) and it will throw a runtime exception from within the offload logic.

        Attachments

        1. GIRAPH-734.patch
          1.0 kB
          Craig Muchinsky

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cmuchinsky@initiatesystems.com Craig Muchinsky
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: