Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15800

Reentrant lock doesn't work after client node reconnects.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.13
    • None
    • Fixed an issue that could lead to incorrect working of the IgniteLock after reconnecting the client node.
    • Release Notes Required

    Description

      When client node reconnects, an existing igniteLock doesn't work
      clientReconnectTest.java
       

      java.lang.IllegalMonitorStateException 2 at org.apache.ignite.internal.processors.datastructures.GridCacheLockImpl$Sync.tryRelease(GridCacheLockImpl.java:449) 3 at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261) 4 at org.apache.ignite.internal.processors.datastructures.GridCacheLockImpl.unlock(GridCacheLockImpl.java:1262)

      the root cause is node id stored in GridCacheLockImpl.Sync.thisNode is not updated after client node rejoins cluster with new node id.

      Steps to reproduce:
      1. Start server node
      2. Start client node
      3. create an instance of IgniteLock
      4. disconnect client node from network (simulate network failure)
      5. restore network, wait for the client to reconnect the server node
      6. start two threads on the client node
      7. in thread 1 call lock() on IgniteLock instance from step 3
      8. in thread 2 call lock() the same IgniteLock instance
      Expected result: thread 2 waits for thread 1 to release lock
      Actual result: thread 2 acquires lock
      9. in thread 1 call unlock() on the same IgniteLock instance
      Expected result: the lock is released by thread 1
      Actual result: thread 1 throws the following exception

      Attachments

        1. clientReconnectTest.java
          2 kB
          Sergey Uttsel

        Issue Links

          Activity

            People

              Sergey Uttsel Sergey Uttsel
              Sergey Uttsel Sergey Uttsel
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m