Details
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
Attachments
Issue Links
- links to