camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-4447) thread safety issue with Exchange.getUnitOfWork()
Date Wed, 14 Sep 2011 13:58:09 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-4447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104504#comment-13104504
] 

Willem Jiang commented on CAMEL-4447:
-------------------------------------

Camel 2.8.1 is promoted to the maven central repo two days ago, you can try it now :)


> thread safety issue with Exchange.getUnitOfWork()
> -------------------------------------------------
>
>                 Key: CAMEL-4447
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4447
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.1
>         Environment: JDK 1.6.0_20 on Linux x86_64
>            Reporter: David Tombs
>
> I'm having a somewhat rare issue with NullPointerExceptions in a multithreaded route.
It seems that there is a race condition between one thread operating on the UnitOfWork and
another removing it. I have gotten the following stacktraces so far:
> {noformat}
> ERROR [Camel0 - Resequencer Delivery] o.a.c.p.StreamResequencer - Caused by: [java.lang.NullPointerException
- null]
> java.lang.NullPointerException: null
> 	at org.apache.camel.processor.DefaultChannel$1.done(DefaultChannel.java:309) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:349)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:116) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:79) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:59) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.StreamResequencer.sendElement(StreamResequencer.java:165)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.StreamResequencer.sendElement(StreamResequencer.java:61)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.resequencer.ResequencerEngine.deliverNext(ResequencerEngine.java:254)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.resequencer.ResequencerEngine.deliver(ResequencerEngine.java:218)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.StreamResequencer$Delivery.run(StreamResequencer.java:212)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> {noformat}
> And:
> {noformat}
> ERROR [Camel0 - Resequencer Delivery] o.a.c.p.StreamResequencer - Caused by: [java.lang.NullPointerException
- null]
> java.lang.NullPointerException: null
> 	at org.apache.camel.impl.DefaultExchange.isTransacted(DefaultExchange.java:331) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:57)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:116) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:79) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:59) ~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.StreamResequencer.sendElement(StreamResequencer.java:165)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.StreamResequencer.sendElement(StreamResequencer.java:61)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.resequencer.ResequencerEngine.deliverNext(ResequencerEngine.java:254)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.resequencer.ResequencerEngine.deliver(ResequencerEngine.java:218)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> 	at org.apache.camel.processor.StreamResequencer$Delivery.run(StreamResequencer.java:212)
~[camel-core-2.8.1-SNAPSHOT.jar:2.8.1-SNAPSHOT]
> {noformat}
> Looking at the source, both NullPointerExceptions were thrown by code like:
> {code}
> return getUnitOfWork() != null && getUnitOfWork().isTransacted();
> {code}
> Oddly, I've only seen this happen soon after startup and only once per run.
> The actual route is company confidential, but it's basically:
> JMS -> Stream Resequencer -> Bean

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message