camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CAMEL-11983) XsltAggregationStrategy thread safety during initialization
Date Thu, 02 Nov 2017 15:41:00 GMT

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

Claus Ibsen reassigned CAMEL-11983:
-----------------------------------

    Assignee: Claus Ibsen

> XsltAggregationStrategy thread safety during initialization
> -----------------------------------------------------------
>
>                 Key: CAMEL-11983
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11983
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-xslt
>    Affects Versions: 2.17.0
>         Environment: Apache Camel 2.17 on EAP Fuse 6.4.0
> Apache Camel 2.20 on Spring Boot standalone
>            Reporter: Pafsanias Ftakas
>            Assignee: Claus Ibsen
>            Priority: Normal
>              Labels: thread-safety
>             Fix For: 2.19.5, 2.20.1, 2.21.0
>
>         Attachments: reentrancy.zip
>
>
> It seems that there is a race condition in the XsltAggregatorStrategy. The following
code:
> {code:java}
> if (xslt == null) {
>     initialize(oldExchange.getContext());
> }
> ...
> xslt.process(oldExchange);
> {code}
> means that potentially one thread might be still working on the initialize call while
another thread passes through the gate of the if statement and executes the xslt.process()
call. If the initialization is not quite complete, the XsltBuilder will throw an exception
complaining that the template has not been set.
> I have written a small Spring Boot project (which I am attaching to this Jira issue)
that demonstrates this. I understand that this only happens when parallelization is present
during the xslt member initialization above, and that it sorts itself out in subsequent calls,
but I have managed to see this during testing, so it is not that impossible for it to happen.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message