[jgroups-dev] LockService concurrent usage issue

Olexandr Markushyn <[email protected]> Wed, 17 Jul 2013 16:35:10 +0000
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>
Greetings,

Could you help to clarify the situation we have with concurent LockService usage please?

We have rather simple test that starts some amount of threads which in turn simultaneously obtain lock through LockService#getLock then perform lock and unlock.
Each thread works during some time.
After couple of seconds of work some threads just hang up in Locking$ClientLock(Object).wait() called indirectly from LockService$LockImpl.tryLock().
Here is stack trace:
Thread [Thread-ClientImitation-1] (Suspended)
                Object.wait(long) line: not available [native method]
                Locking$ClientLock(Object).wait() line: 485
                Locking$ClientLock.acquireTryLock(long, boolean) line: 1010
                Locking$ClientLock.tryLock() line: 896
                CENTRAL_LOCK(Locking).down(Event) line: 152
                ProtocolStack.down(Event) line: 1025
                JChannel.down(Event) line: 718
                LockService$LockImpl.tryLock() line: 102
                LockServiceStabilityTestCase$ClientImitation.run() line: 167
                Thread.run() line: 662

I've attached the test just in case (lockservice_stability_testcase.ja_).
Attached test is hardcoded to work during 20 seconds with 15 threads.
Java source is inside of the attachment.
We are able to reproduce the problem under MyEclipse IDE with 2 threads in 4 seconds.
But in case of simple JVM start it is not reproducible sometimes even with 15 threads and in 20 seconds.

Command line:
\jdk1.6.0_31\jre\bin\java.exe -cp junit-4.4.jar;jgroups-3.2.4.Final.jar;log4j-1.2.15.jar;lockservice_stability_testcase.jar org.junit.runner.JUnitCore com.softcomputer.softweb.infl.commons.clustering.stabilitytest.LockServiceStabilityTestCase

Dependencies:
jgroups-3.2.4.Final.jar (with jgroups-3.3.3.Final the situation is the same)
junit-4.4.jar
log4j-1.2.15.jar (log4j.xml is inside. It creates test.trace file)

Best regards,
Oleksandr Markushyn

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
Javagroups-development mailing list
lockservice_stability_testcase.ja_ (application/octet-stream, 34.4 KB) - not displayed