History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1690
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rob Davies
Reporter: Gary Tully
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

QuickJPAStoreRecoveryBrokerTest.testQueueNonPersistentMessagesLostOnRestart sometimes fails, timing issue with broker shutdown

Created: 25/Apr/08 07:06 AM   Updated: 12/May/08 02:54 AM
Component/s: Test Cases
Affects Version/s: 5.1.0
Fix Version/s: 5.1.0

Time Tracking:
Not Specified

File Attachments: 1. Text File Licensed for inclusion in ASF works jpaShutdownFailure.patch (1 kb)

Environment: windows

Patch Info: Patch Available


 Description  « Hide
QuickJPAStoreRecoveryBrokerTest.testQueueNonPersistentMessagesLostOnRestart can fail with the stack trace below.
the problem is that the vmtransport can be persisting data while the broker is attempting to close the persistence adapter.

The brokerService has a comment to have the VMTransport shuts down after the services, but puts it last of all. Moving the shutdown of the vmtransport to just before the persistence adapter shutdown works better for this test case.

[08:16:01]: org.apache.activemq.broker.store.QuickJPAStoreRecoveryBrokerTest (21s)
[08:16:01]: [org.apache.activemq.broker.store.QuickJPAStoreRecoveryBrokerTest] testTopicDurableConsumerHoldsPersistentMessageAfterRestart (1s)
[08:16:01]: [testTopicDurableConsumerHoldsPersistentMessageAfterRestart]
[08:16:01]: [testTopicDurableConsumerHoldsPersistentMessageAfterRestart] &openjpa-1.0.0-r420667:568756 nonfatal user error& org.apache.openjpa.persistence.InvalidStateException: This operation failed for some instances. See the nested exceptions array for details.
at org.apache.openjpa.kernel.AbstractBrokerFactory.assertNoActiveTransaction(AbstractBrokerFactory.java:696)
at org.apache.openjpa.kernel.AbstractBrokerFactory.close(AbstractBrokerFactory.java:373)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.close(DelegatingBrokerFactory.java:183)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:286)
at org.apache.activemq.store.jpa.JPAPersistenceAdapter.stop(JPAPersistenceAdapter.java:198)
at org.apache.activemq.store.amq.AMQPersistenceAdapter.stop(AMQPersistenceAdapter.java:307)
at org.apache.activemq.util.ServiceStopper.stop(ServiceStopper.java:41)
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:484)
at org.apache.activemq.broker.BrokerTestSupport.tearDown(BrokerTestSupport.java:101)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.apache.activemq.CombinationTestSupport.runBare(CombinationTestSupport.java:90)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(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:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(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:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: &openjpa-1.0.0-r420667:568756 nonfatal user error& org.apache.openjpa.persistence.InvalidStateException: This operation cannot be performed while a Transaction is active.
FailedObject: org.apache.openjpa.persistence.EntityManagerImpl@1f23ca4
at org.apache.openjpa.kernel.AbstractBrokerFactory.assertNoActiveTransaction(AbstractBrokerFactory.java:690)
... 30 more



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Gary Tully - 25/Apr/08 07:08 AM
change the shutdown order so there are no inflight transactions in the persistence adapter when it is shutdown

Rob Davies - 25/Apr/08 07:41 AM
Applied by SVN revision 651618