[ https://issues.apache.org/jira/browse/CAMEL-21162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-21162: ----------------------------------- Assignee: Claus Ibsen > Cannot reset StreamCache when the spool file has been deleted > ------------------------------------------------------------- > > Key: CAMEL-21162 > URL: https://issues.apache.org/jira/browse/CAMEL-21162 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 4.4.0, 4.5.0, 4.6.0, 4.7.0 > Environment: Camel Version: > 4.3.0 > > Reporter: Cristian > Assignee: Claus Ibsen > Priority: Major > Fix For: 4.8.0 > > Attachments: streamcaching_store_deletion.tar.gz > > > During a migration path that will take us from Camel 3.x to Camel 4.x we > encountered a problem with one of our Routes. > Our Route tries to save the body of an http request to disk. > The raised error preventing the correct execution of the route is the > following: "{*}Cannot reset stream from file > /tmp/camel-cache/cos7703786668416470635.tmp{*}". > After debugging to understand the reason, I noticed that the execution flow > compared to version 3 has changed with the introduction of the change that > leads the _WrappedInputStream_ class to implement the _StreamCache_ -> {*}Var > headers interface (#12960){*}. > In fact, a downgrade to version 4.3.0, the version prior to the introduction > of the change, solved our problem and the route started working again. > The problem, which occurs when streamcaching spools to disk, is due to the > fact that in the convertToStreamCache method of the StreamCachingHelper class > the body of the message enters the else because it is an instance of > StreamCache and does not continue towards the tryStreamCache method as in > previous versions. > In our case, when we save the body of the http request to disk, the temp file > used for spooling is deleted (FileInputStreamCache.cleanUpTempFile) before > all StreamCache resets are performed (StreamCachingAdvice.after). > At that point, during the StreamCache reset, the code finds that the temp > file has been deleted and raises the reported RuntimeCamelException exception. > I attached an example that reproduces the problem. -- This message was sent by Atlassian Jira (v8.20.10#820010)