You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by adipro <ad...@zohocorp.com> on 2020/06/02 12:17:00 UTC

Semaphore Lock Not Acquired. Race issue?

Server 1 -> Let's say IP is X. Status is running.

Server 2 -> Let's say IP is Y. Status is not running. We stopped this node
for various reasons.

Client1 -> TcpDiscoveryVmIpFinder ipAddress list has two server IPs - X,Y

Client 2 -> TcpDiscoveryVmIpFinder ipAddress list has two server IPs - X,Y


When we start Client1, and Client 2 App machines both at a time. In Client2
App machine, we found the following thread trace. A thread is kept waiting
here since that App started.


```
"1 - 1591083466169" #168 prio=5 os_prio=0 tid=0x00007f60e416b800 nid=0x8034
waiting on condition [0x00007f5fde005000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x0000000739a4eb78> (a
java.util.concurrent.CountDownLatch$Sync)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:837)
	at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:999)
	at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1308)
	at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
	at org.apache.ignite.internal.util.IgniteUtils.await(IgniteUtils.java:7824)
	at
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor.awaitInitialization(DataStructuresProcessor.java:1161)
	at
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor.getAtomic(DataStructuresProcessor.java:505)
	at
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor.semaphore(DataStructuresProcessor.java:1270)
	at
org.apache.ignite.internal.IgniteKernal.semaphore(IgniteKernal.java:3930)
	at
com.a.b.common.ignite.IgniteConnectionHandler.getSemaphore(IgniteConnectionHandler.java:110)
	at
com.a.b.common.ignite.IgniteConnectionHandler.startIgniteObject(IgniteConnectionHandler.java:78)
	at
com.a.b.common.ignite.IgniteConnectionHandler.getConnection(IgniteConnectionHandler.java:138)
	at
com.a.b.common.ignite.IgniteConnectionHandler.<clinit>(IgniteConnectionHandler.java:32)
	at com.a.b.common.ignite.IgniteUtil.keys(IgniteUtil.java:489)
```


Can someone tell why it is WAITING here in Client2? In Client1 there were no
issues and everything is working fine. All the threads in Client2 are in
waiting state as "IgniteConnectionHandler" class's static block code is not
completed.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Semaphore Lock Not Acquired. Race issue?

Posted by adipro <ad...@zohocorp.com>.
When I removed the stopped Server node IP from Client IP list and server IP
list and start both clients, it is working fine.

Although I couldn't reproduce it again. If I found it again, I'll try taking
dumps and reply it in this thread.

Java version -> jdk 1.8.0_152
Ignite version -> 8.7.10

Thank you.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Semaphore Lock Not Acquired. Race issue?

Posted by akorensh <al...@gmail.com>.
Also wanted to mention that there is a working semaphore example available:
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteSemaphoreExample.java



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Semaphore Lock Not Acquired. Race issue?

Posted by akorensh <al...@gmail.com>.
Hi,
  In an older version there was an issue that caused this condition
  https://issues.apache.org/jira/browse/IGNITE-8987

  Send a reproducer, mention the version you are using, along with Ignite
logs(from both nodes) and a stack trace of both servers when this condition
occurs.  

  How to take thread dump:
https://stackoverflow.com/questions/10756105/how-to-get-a-complete-stack-trace-of-a-running-java-program-that-is-taking-100

  Also mention what java version you are using.
Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/