[
https://issues.apache.org/jira/browse/CAMEL-8758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14536831#comment-14536831
]
ASF GitHub Bot commented on CAMEL-8758:
---------------------------------------
GitHub user sabre1041 opened a pull request:
https://github.com/apache/camel/pull/513
CAMEL-8758: Fix to Camel Cache producer to avoid NPE in race condition
Fix to avoid potential race condition which can cause NPE. An element is
retrieved from the cache to perform a null check and if not null, retrieved
once again to perform object retrieval. If the object is either removed from
the cache or TTL expires, can result in NPE.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sabre1041/camel CAMEL-8758
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/513.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #513
----
commit b684be16fce360000bad4853666d29a8f7f56781
Author: Andrew Block <[email protected]>
Date: 2015-05-09T18:02:56Z
CAMEL-8758: Fix to Camel Cache producer to avoid NPE in race condition
----
> NPE for CacheComponent
> ----------------------
>
> Key: CAMEL-8758
> URL: https://issues.apache.org/jira/browse/CAMEL-8758
> Project: Camel
> Issue Type: Bug
> Components: camel-cache
> Affects Versions: 2.14.2
> Reporter: Jeremy
> Priority: Minor
>
> I have randomly NPE for cache component
> java.lang.NullPointerException
> at
> org.apache.camel.component.cache.CacheProducer.performCacheOperation(CacheProducer.java:98)
> at
> org.apache.camel.component.cache.CacheProducer.process(CacheProducer.java:71)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
> at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1101)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1093)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:990)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)