Thread: Messaging Pattern Test Hang

This question is not answered. Helpful answers available: 5. Correct answers available: 1.


Permlink Replies: 2 - Pages: 1 - Last Post: Oct 21, 2009 10:36 AM Last Post By: james.bayer Threads: [ Previous | Next ]
james.bayer

Posts: 858
Registered: 07/03/08
Messaging Pattern Test Hang
Posted: Oct 15, 2009 9:28 AM
 
Click to report abuse...   Click to reply to this thread Reply
When running the testng test for the messaging pattern, I noticed that under some scenarios I've encountered a hang.

In some scenarios I am using a single cache server and running the tests with localstorage=false. I have also seen this behavior when running the test with localstorage=true without a dedicated cache server.

"Main Thread" id=1 idx=0x4 tid=2728 prio=5 alive, in native, parked
    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x08E02748
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2506)
    at sun/misc/Unsafe.park(ZJ)V(Native Method)
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
    at com/oracle/coherence/patterns/messaging/AbstractSubscriber.getNextSubscriptionUpdate(AbstractSubscriber.java:247)
    at com/oracle/coherence/patterns/messaging/AbstractSubscriber.ensureSubscription(AbstractSubscriber.java:278)
    at com/oracle/coherence/patterns/messaging/TopicSubscriber.rollback(TopicSubscriber.java:180)
    at TopicTests.nonDurableRollbackTest(TopicTests.java:88)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    at jrockit/vm/Reflect.invokeMethod(Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Native Method)
    at sun/reflect/NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Native Method)
    at sun/reflect/NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java/lang/reflect/Method.invoke(Method.java:597)
    at org/testng/internal/MethodHelper.invokeMethod(MethodHelper.java:609)
    at org/testng/internal/Invoker.invokeMethod(Invoker.java:532)
    at org/testng/internal/Invoker.invokeTestMethod(Invoker.java:686)
    at org/testng/internal/Invoker.invokeTestMethods(Invoker.java:1018)
    at org/testng/internal/TestMethodWorker.invokeTestMethods(TestMethodWorker.java:128)
    at org/testng/internal/TestMethodWorker.run(TestMethodWorker.java:112)
    at org/testng/TestRunner.runWorkers(TestRunner.java:759)
    at org/testng/TestRunner.privateRun(TestRunner.java:592)
    at org/testng/TestRunner.run(TestRunner.java:486)
    at org/testng/SuiteRunner.runTest(SuiteRunner.java:332)
    at org/testng/SuiteRunner.runSequentially(SuiteRunner.java:327)
    at org/testng/SuiteRunner.privateRun(SuiteRunner.java:299)
    at org/testng/SuiteRunner.run(SuiteRunner.java:204)
    at org/testng/TestNG.createAndRunSuiteRunners(TestNG.java:912)
    at org/testng/TestNG.runSuitesLocally(TestNG.java:876)
    at org/testng/TestNG.run(TestNG.java:784)
    at org/testng/TestNG.privateMain(TestNG.java:949)
    at org/testng/TestNG.main(TestNG.java:922)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace

It appears that in AbstractSubscriber there may be a potential for a hang with this code, but I'm not sure. It looks like the call to getNextSubscriptionUpdate() is in the call path.

void ensureSubscription() {
		State state = getState();
		
		if (state == State.Starting) {
			//wait for the subscription state to arrive
			getNextSubscriptionUpdate();
			
		}


If the subscription does move into the Active state before the subscriptionUpdates.take() is called (I'm not even sure if that's possible, but presume it is), then could this be why I'm seeing a lock?

protected S getNextSubscriptionUpdate() {
		try {
			//get the next available subscription state
			//(wait's if it has not arrived)
			S subscription = subscriptionUpdates.take();

Thanks,

James

pmackin

Posts: 62
Registered: 01/10/01
Re: Messaging Pattern Test Hang
Posted: Oct 19, 2009 6:15 AM   in response to: james.bayer in response to: james.bayer
 
Click to report abuse...   Click to reply to this thread Reply
James

Thank you for reporting this. What version of coherence and the messaging pattern are you using?

Paul
james.bayer

Posts: 858
Registered: 07/03/08
Re: Messaging Pattern Test Hang
Posted: Oct 21, 2009 10:36 AM   in response to: pmackin in response to: pmackin
 
Click to report abuse...   Click to reply to this thread Reply
I am currently using Coherence 3.5.2/463 with
coherence-common-1.4.0.jar
coherence-commandpattern-2.4.0.jar
coherence-messagingpattern-2.4.0.jar

I also experienced this with Coherence 3.5.1.

It is not reproducible everytime, in fact after having it happen once this morning I have not reproduced it in 4 subsequent tests. I have only noticed it with JRockit and not with Hotspot, but I test more frequently with JRockit.

C:\Oracle\coherence-incubator\coherence-messagingpattern-2.4.0\run_examples>java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
BEA JRockit(R) (build R27.6.2-20_o-108500-1.6.0_05-20090120-1116-windows-ia32, compiled mode)

Thanks,

James
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums