camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arno Noordover (JIRA)" <>
Subject [jira] [Commented] (CAMEL-10116) NullPointerException in DefaultAsyncProcessorAwaitManager
Date Mon, 04 Jul 2016 18:40:10 GMT


Arno Noordover commented on CAMEL-10116:

Notes so far:
- The List of MessageHistory might be added to the exchange in a thread unsafe manner;
- Sometimes a defensive copy is made of the List (e.g. line 152 in DefaultExchange, line 916
in ExchangeHelper);
- I found one place where the existence of Exchange.MESSAGE_HISTORY property is checked. If
it isn't present it is created and added to the properties hashmap (CamelInternalProcessor
line 746);

- Should there be a new class introduced e.g. MessageHistories which hides the collection
implementation for the message history functionality?
- Should there be a method in Exchange like putIfAbsent from the ConcurrentHashMap which adds
a new element to the hashmap  if it isn't present or returns the existing element in a thread-safe
- Should the defensive copy functionality be thread-safe? I don't know yet what would happen
in a multi threaded solution.
- Do we need to make a defensive copy of the MESSAGE_HISTORY property when making a safe-copy
of the properties? Maybe we shouldn't make a defensive copy and need to use the same instance.
What happens when another thread adds a MessageHistory to the old properties map?
- Are there other places where the MESSAGE_HISTORY is added to the properties HashMap?

> NullPointerException in DefaultAsyncProcessorAwaitManager
> ---------------------------------------------------------
>                 Key: CAMEL-10116
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.17.1
>            Reporter: Wolfgang Nagele
>            Assignee: Arno Noordover
>             Fix For: 2.17.3, 2.18.0
> The following statement can cause a NPE (line #256 in DefaultAsyncProcessorAwaitManager
at version 2.17.1):
> {{MessageHistory history = list.get(list.size() - 1);}}
> {code}
> java.lang.NullPointerException: null
>         at org.apache.camel.impl.DefaultAsyncProcessorAwaitManager$AwaitThreadEntry.<init>(
>         at org.apache.camel.impl.DefaultAsyncProcessorAwaitManager$AwaitThreadEntry.<init>(
>         at org.apache.camel.impl.DefaultAsyncProcessorAwaitManager.await(
>         at org.apache.camel.util.AsyncProcessorHelper.process(
>         at org.apache.camel.processor.DelegateAsyncProcessor.process(
>         at
>         at
>         at
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at [na:1.8.0_91]
> {code}

This message was sent by Atlassian JIRA

View raw message