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

Bartosz Popiela edited comment on CAMEL-20965 at 7/17/24 1:42 AM:
------------------------------------------------------------------

Fixed by the pr [14502|https://github.com/apache/camel/pull/14502]. 


was (Author: bartoszpop):
Reopening the issue as it still occurs. I'll provide a fix.

> InputStreamCache is not thread-safe
> -----------------------------------
>
>                 Key: CAMEL-20965
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20965
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 4.4.3, 4.6.0
>            Reporter: Bartosz Popiela
>            Priority: Minor
>             Fix For: 4.7.0
>
>
> InputStreamCache is reset after each step 
> (org.apache.camel.impl.engine.CamelInternalProcessor.StreamCachingAdvice#after),
>  and if there are two threads processing the same InputStreamCache (e.g. 
> Seda), there may be a case where one thread invokes InputStreamCache#reset 
> (org.apache.camel.support.MessageHelper#resetStreamCache) while another 
> thread converts this InputStreamCache to String 
> (org.apache.camel.util.IOHelper#toString(java.io.BufferedReader, long). It 
> leads to java.io.ByteArrayInputStream#pos being reset and the target String 
> having duplicate entries.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to