You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Stan Lewis (JIRA)" <ji...@apache.org> on 2010/02/24 16:38:41 UTC
[jira] Created: (CAMEL-2496) StreamCache/Splitter race condition
StreamCache/Splitter race condition
-----------------------------------
Key: CAMEL-2496
URL: https://issues.apache.org/activemq/browse/CAMEL-2496
Project: Apache Camel
Issue Type: Bug
Affects Versions: 1.6.2
Reporter: Stan Lewis
Attached patch introduces a test that shows the following symptom:
org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57936#action_57936 ]
Claus Ibsen commented on CAMEL-2496:
------------------------------------
I think we should use the new HawtDB as file based stream cache in the future.
It got all the bells and whistles to be fast and leverages NIO and memory mapped IO and whatnot.
But that can be done when we overhaul stream caching in 2.x, once we get the time for that :)
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Stan Lewis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stan Lewis updated CAMEL-2496:
------------------------------
Attachment: test-case.txt
Patch for 1.x branch, still need to check if 2.x trunk shows a similar problem.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2496) StreamCache/Splitter race
condition
Posted by "Stan Lewis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57836#action_57836 ]
Stan Lewis edited comment on CAMEL-2496 at 2/24/10 3:39 PM:
------------------------------------------------------------
unit test for 1.x branch, still need to check if 2.x trunk shows a similar problem.
was (Author: slewis):
Patch for 1.x branch, still need to check if 2.x trunk shows a similar problem.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang resolved CAMEL-2496.
---------------------------------
Fix Version/s: 2.4.0
Resolution: Fixed
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 2.0-M1, 1.6.1, 1.6.2, 2.0-M2, 2.0-M3, 2.0.0, 2.1.0, 2.2.0, 2.3.0
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Fix For: 2.4.0
>
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59000#action_59000 ]
Willem Jiang commented on CAMEL-2496:
-------------------------------------
Committed the test case into camel trunk, will revisit it when we have time to rewrite the StreamCache.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58997#action_58997 ]
Willem Jiang commented on CAMEL-2496:
-------------------------------------
After digging the code, I found the FileInputStreamCache is closed when the XPathBuilder.getDocument() is called, and the temp file is deleted, so you get the FileNotFoundException when the XPathBuilder wants to reset the InputStream.
I can also reproduce this issue in Camel 2.x.
To work around this issue, we should not use the FileInputStreamCache as it can't be reset after it is closed.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59958#action_59958 ]
Willem Jiang commented on CAMEL-2496:
-------------------------------------
Now the cached file will not be deleted before the exchange's routing is finished, so you will not got this kind of error anymore.
The file will be deleted when the CachedFileInputStream which is built on this file is close and routing is finished.
You can find more information in CAMEL-2776.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang reassigned CAMEL-2496:
-----------------------------------
Assignee: Willem Jiang
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Roland Knight (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59620#action_59620 ]
Roland Knight commented on CAMEL-2496:
--------------------------------------
This looks like the issue I just reported in CAMEL-2776. It may not be a race condition but a side effect of the cached stream file removal upon close().
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-2496) StreamCache/Splitter race condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang updated CAMEL-2496:
--------------------------------
Affects Version/s: 2.3.0
2.2.0
2.1.0
2.0.0
2.0-M3
2.0-M2
1.6.1
2.0-M1
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 2.0-M1, 1.6.1, 1.6.2, 2.0-M2, 2.0-M3, 2.0.0, 2.1.0, 2.2.0, 2.3.0
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Fix For: 2.4.0
>
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2496) StreamCache/Splitter race
condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58997#action_58997 ]
Willem Jiang edited comment on CAMEL-2496 at 4/21/10 5:09 AM:
--------------------------------------------------------------
After digging the code, I found the FileInputStreamCache is closed when the XPathBuilder.getDocument() is called, and the temp file is deleted, so you get the FileNotFoundException when the XPathBuilder wants to reset the InputStream.
I can also reproduce this issue in Camel 2.x.
To work around this issue, we should not use the FileInputStreamCache as it can't be reset after it is closed, set the camel property CachedOutputStream.THRESHOLD to be "-1" can disable the FileInputStreamCache.
{code}
getContext().getProperties().put(CachedOutputStream.THRESHOLD, "-1") ;
{code}
was (Author: njiang):
After digging the code, I found the FileInputStreamCache is closed when the XPathBuilder.getDocument() is called, and the temp file is deleted, so you get the FileNotFoundException when the XPathBuilder wants to reset the InputStream.
I can also reproduce this issue in Camel 2.x.
To work around this issue, we should not use the FileInputStreamCache as it can't be reset after it is closed, set the camel property getContext().getProperties().put(CachedOutputStream.THRESHOLD, "-1") can disable the FileInputStreamCache.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CAMEL-2496) StreamCache/Splitter race
condition
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58997#action_58997 ]
Willem Jiang edited comment on CAMEL-2496 at 4/21/10 5:08 AM:
--------------------------------------------------------------
After digging the code, I found the FileInputStreamCache is closed when the XPathBuilder.getDocument() is called, and the temp file is deleted, so you get the FileNotFoundException when the XPathBuilder wants to reset the InputStream.
I can also reproduce this issue in Camel 2.x.
To work around this issue, we should not use the FileInputStreamCache as it can't be reset after it is closed, set the camel property getContext().getProperties().put(CachedOutputStream.THRESHOLD, "-1") can disable the FileInputStreamCache.
was (Author: njiang):
After digging the code, I found the FileInputStreamCache is closed when the XPathBuilder.getDocument() is called, and the temp file is deleted, so you get the FileNotFoundException when the XPathBuilder wants to reset the InputStream.
I can also reproduce this issue in Camel 2.x.
To work around this issue, we should not use the FileInputStreamCache as it can't be reset after it is closed.
> StreamCache/Splitter race condition
> -----------------------------------
>
> Key: CAMEL-2496
> URL: https://issues.apache.org/activemq/browse/CAMEL-2496
> Project: Apache Camel
> Issue Type: Bug
> Affects Versions: 1.6.2
> Reporter: Stan Lewis
> Assignee: Willem Jiang
> Attachments: test-case.txt
>
>
> Attached patch introduces a test that shows the following symptom:
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: /var/folders/vC/vCA487MkHEeSaIu9LmlkrU+++TI/-Tmp-/camel-tmp-627613/cos3755307044377901165.tmp (No such file or directory)
> at org.apache.camel.converter.stream.FileInputStreamCache.reset(FileInputStreamCache.java:52)
> at org.apache.camel.converter.stream.StreamCacheConverter$StreamSourceCache.reset(StreamCacheConverter.java:126)
> at org.apache.camel.util.MessageHelper.resetStreamCache(MessageHelper.java:105)
> at org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:548)
> at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:428)
> at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:118)
> at org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:155)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
> at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
> at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
> at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:72)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:637)
> I believe it must be a race condition when several threads are passing through the splitter, in the above case I'm using a seda queue with 5 threads. Am logging this now as I'm not sure what time I'll have to investigate further this week.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.