You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Vincent Lombart (JIRA)" <ji...@apache.org> on 2012/12/21 14:05:14 UTC

[jira] [Closed] (CAMEL-5900) StreamResequencer does not resequence correctly

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

Vincent Lombart closed CAMEL-5900.
----------------------------------

    Resolution: Cannot Reproduce
    
> StreamResequencer does not resequence correctly
> -----------------------------------------------
>
>                 Key: CAMEL-5900
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5900
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.11.0
>         Environment: Windows XP dual-core, Sun JDK 1.6.x
> Ubuntu Linux quad-core, openjdk 6b24-1.11.5-0ubuntu1~12.04.1
> Ubuntu Linux quad-core, openjdk 7u9-2.3.3-0ubuntu1~12.04.1
> Camel 2.10 release version
> Camel 2.11 snapshot code, svn checkout on 2012-12-18.
>            Reporter: Vincent Lombart
>             Fix For: 2.11.0
>
>
> On some routes we noticed that the StreamResequencer was not resequencing correctly. By playing with the Camel unit test (org.apache.camel.processor.StreamResequencerTest) I was able to reproduce the problem.
> Test setup: 
> 1. In the createRouteBuilder() method change the capacity and timeout to avoid false problems. I used:
> from("direct:start").resequence(header("seqnum")).stream().capacity(10000).timeout(20000L).to("mock:result");
> 2. In the testMultithreaded() method change numMessages to a high number (I used 9000).
> 3. Run the unit test several times until it fails. It does not fail consistently which probably indicates a race condition / wrong synchronization. You might have to adapt the numbers above to have it fail on other configurations.
> The testSendMessagesInWrongOrderButReceiveThemInCorrectOrder() often fails with
> java.lang.AssertionError: mock://result Received message count. Expected: <4> but was: <0>
> 	at org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:1318)
> 	at org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:1300)
> 	at org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:372)
> 	at org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:351)
> 	at org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:339)
> 	at org.apache.camel.processor.StreamResequencerTest.testSendMessagesInWrongOrderButReceiveThemInCorrectOrder(StreamResequencerTest.java:56)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at junit.framework.TestCase.runTest(TestCase.java:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at org.apache.camel.TestSupport.runBare(TestSupport.java:58)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:243)
> 	at junit.framework.TestSuite.run(TestSuite.java:238)
> 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> I also often get the testMultithreaded() that fails with:
> Exception in thread "pool-2-thread-2" org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: msg5181]
> 	at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1287)
> 	at org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:618)
> 	at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:454)
> 	at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:450)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:152)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:146)
> 	at org.apache.camel.processor.StreamResequencerTest$Sender.run(StreamResequencerTest.java:147)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.camel.CamelExchangeException: No consumers available on endpoint: Endpoint[direct://start]. Exchange[Message: msg5181]
> 	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:56)
> 	at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> 	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
> 	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
> 	at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:366)
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:1)
> 	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
> 	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:337)
> 	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:175)
> 	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:111)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:150)
> 	... 5 more
> Exception in thread "pool-2-thread-1" org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: msg5184]
> 	at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1287)
> 	at org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:618)
> 	at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:454)
> 	at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:450)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:152)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:146)
> 	at org.apache.camel.processor.StreamResequencerTest$Sender.run(StreamResequencerTest.java:147)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.camel.CamelExchangeException: No consumers available on endpoint: Endpoint[direct://start]. Exchange[Message: msg5184]
> 	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:56)
> 	at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> 	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
> 	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
> 	at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:366)
> 	at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:1)
> 	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
> 	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:337)
> 	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:175)
> 	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:111)
> 	at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:150)
> 	... 5 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira