Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3124

AtomicHashMap.put is not atomic with pessimistic locking

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 5.2.7.Final, 5.3.0.Beta1
    • 5.3.0.CR2, 5.3.0.Final
    • Core
    • None
    • Workaround Exists
    • Hide

      Use AdvancedCache.lock to lock the atomic map key explicitly before modifying it.

      Show
      Use AdvancedCache.lock to lock the atomic map key explicitly before modifying it.

    Description

      When the user calls AtomicHashMap.put(k, v), AtomicHashMapProxy.getDeltaMapForWrite() first reads the atomic map in the invocation context, and only acquires a lock afterwards.

      Between the read and the lock, another transaction can write something to the atomic map, and that write will be lost.

      Attachments

        Issue Links

          Activity

            People

              dberinde@redhat.com Dan Berindei
              dberinde@redhat.com Dan Berindei
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: