You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Sergey Uttsel (Jira)" <ji...@apache.org> on 2021/10/22 07:02:00 UTC

[jira] [Updated] (IGNITE-15800) Reentrant lock doesn't work after client node reconnects.

     [ https://issues.apache.org/jira/browse/IGNITE-15800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Uttsel updated IGNITE-15800:
-----------------------------------
    Description: 
When client node reconnects, an existing igniteLock doesn't work
 [^clientReconnectTest.java]
  
{code: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){code}

 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

  was:
When client node reconnects, an existing igniteLock doesn't work
[^clientReconnectTest.java]
 
{{}}
{code: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){code}
{{}}
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


> Reentrant lock doesn't work after client node reconnects.
> ---------------------------------------------------------
>
>                 Key: IGNITE-15800
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15800
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Uttsel
>            Assignee: Sergey Uttsel
>            Priority: Major
>         Attachments: clientReconnectTest.java
>
>
> When client node reconnects, an existing igniteLock doesn't work
>  [^clientReconnectTest.java]
>   
> {code: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){code}
>  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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)