You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Anders (Created) (JIRA)" <ji...@apache.org> on 2012/04/16 12:36:17 UTC
[jira] [Created] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
"IOException: No space left on device" exception swallowed by camel
-------------------------------------------------------------------
Key: CAMEL-5178
URL: https://issues.apache.org/jira/browse/CAMEL-5178
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.9.1, 2.9.0
Reporter: Anders
When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
{code:title=GenericFileConsumer.java|borderStyle=solid}
protected void processExchange(final Exchange exchange) {
GenericFile<T> file = getExchangeFileProperty(exchange);
log.trace("Processing file: {}", file);
// must extract the absolute name before the begin strategy as the file could potentially be pre moved
// and then the file name would be changed
String absoluteFileName = file.getAbsoluteFilePath();
// check if we can begin processing the file
try {
final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
if (!begin) {
log.debug(endpoint + " cannot begin processing file: {}", file);
// begin returned false, so remove file from the in progress list as its no longer in progress
endpoint.getInProgressRepository().remove(absoluteFileName);
return;
}
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
}
endpoint.getInProgressRepository().remove(absoluteFileName);
return;
}
.
.
.
.
}
{code}
When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
{noformat}
11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
java.io.IOException: No space left on device
at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
{noformat}
I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254640#comment-13254640 ]
Claus Ibsen commented on CAMEL-5178:
------------------------------------
This is by design.
Before a message can successfully be created/received by Camel, all error handling is component specific.
The error handling from the route etc is only when Camel routes messages.
We could possible raise the logging level and have a WARN logging if we cannot get a lock on the file.
> "IOException: No space left on device" exception swallowed by camel
> -------------------------------------------------------------------
>
> Key: CAMEL-5178
> URL: https://issues.apache.org/jira/browse/CAMEL-5178
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.9.0, 2.9.1
> Reporter: Anders
>
> When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
> {code:title=GenericFileConsumer.java|borderStyle=solid}
> protected void processExchange(final Exchange exchange) {
> GenericFile<T> file = getExchangeFileProperty(exchange);
> log.trace("Processing file: {}", file);
> // must extract the absolute name before the begin strategy as the file could potentially be pre moved
> // and then the file name would be changed
> String absoluteFileName = file.getAbsoluteFilePath();
> // check if we can begin processing the file
> try {
> final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
> boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
> if (!begin) {
> log.debug(endpoint + " cannot begin processing file: {}", file);
> // begin returned false, so remove file from the in progress list as its no longer in progress
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> } catch (Exception e) {
> if (log.isDebugEnabled()) {
> log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
> }
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> .
> .
> .
> .
> }
> {code}
> When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
> {noformat}
> 11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
> java.io.IOException: No space left on device
> at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
> at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
> at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
> at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
> at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
> {noformat}
> I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256409#comment-13256409 ]
Claus Ibsen commented on CAMEL-5178:
------------------------------------
You can configure your custom exclusiveReadLockStrategy and handle such exception in that code.
> "IOException: No space left on device" exception swallowed by camel
> -------------------------------------------------------------------
>
> Key: CAMEL-5178
> URL: https://issues.apache.org/jira/browse/CAMEL-5178
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.9.0, 2.9.1
> Reporter: Anders
>
> When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
> {code:title=GenericFileConsumer.java|borderStyle=solid}
> protected void processExchange(final Exchange exchange) {
> GenericFile<T> file = getExchangeFileProperty(exchange);
> log.trace("Processing file: {}", file);
> // must extract the absolute name before the begin strategy as the file could potentially be pre moved
> // and then the file name would be changed
> String absoluteFileName = file.getAbsoluteFilePath();
> // check if we can begin processing the file
> try {
> final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
> boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
> if (!begin) {
> log.debug(endpoint + " cannot begin processing file: {}", file);
> // begin returned false, so remove file from the in progress list as its no longer in progress
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> } catch (Exception e) {
> if (log.isDebugEnabled()) {
> log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
> }
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> .
> .
> .
> .
> }
> {code}
> When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
> {noformat}
> 11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
> java.io.IOException: No space left on device
> at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
> at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
> at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
> at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
> at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
> {noformat}
> I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
Posted by "Anders (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254644#comment-13254644 ]
Anders commented on CAMEL-5178:
-------------------------------
That sounds like a good design choice but it also means that its hard for clients to detect such error (without looking in the log). A solution would be to re-factor the following code in GenericFileConsumer.processExchange
{code:title=GenericFileConsumer.java|borderStyle=solid}
try {
final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
if (!begin) {
log.debug(endpoint + " cannot begin processing file: {}", file);
// begin returned false, so remove file from the in progress list as its no longer in progress
endpoint.getInProgressRepository().remove(absoluteFileName);
return;
}
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
}
endpoint.getInProgressRepository().remove(absoluteFileName);
return;
}
{code}
to its own protected method, so it can be be subclassed and extended by client in order to detect such an error and handled by the application instead of just being logged.
> "IOException: No space left on device" exception swallowed by camel
> -------------------------------------------------------------------
>
> Key: CAMEL-5178
> URL: https://issues.apache.org/jira/browse/CAMEL-5178
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.9.0, 2.9.1
> Reporter: Anders
>
> When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
> {code:title=GenericFileConsumer.java|borderStyle=solid}
> protected void processExchange(final Exchange exchange) {
> GenericFile<T> file = getExchangeFileProperty(exchange);
> log.trace("Processing file: {}", file);
> // must extract the absolute name before the begin strategy as the file could potentially be pre moved
> // and then the file name would be changed
> String absoluteFileName = file.getAbsoluteFilePath();
> // check if we can begin processing the file
> try {
> final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
> boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
> if (!begin) {
> log.debug(endpoint + " cannot begin processing file: {}", file);
> // begin returned false, so remove file from the in progress list as its no longer in progress
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> } catch (Exception e) {
> if (log.isDebugEnabled()) {
> log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
> }
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> .
> .
> .
> .
> }
> {code}
> When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
> {noformat}
> 11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
> java.io.IOException: No space left on device
> at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
> at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
> at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
> at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
> at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
> {noformat}
> I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
Posted by "Claus Ibsen (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-5178:
----------------------------------
Assignee: Claus Ibsen
> "IOException: No space left on device" exception swallowed by camel
> -------------------------------------------------------------------
>
> Key: CAMEL-5178
> URL: https://issues.apache.org/jira/browse/CAMEL-5178
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.9.0, 2.9.1
> Reporter: Anders
> Assignee: Claus Ibsen
>
> When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
> {code:title=GenericFileConsumer.java|borderStyle=solid}
> protected void processExchange(final Exchange exchange) {
> GenericFile<T> file = getExchangeFileProperty(exchange);
> log.trace("Processing file: {}", file);
> // must extract the absolute name before the begin strategy as the file could potentially be pre moved
> // and then the file name would be changed
> String absoluteFileName = file.getAbsoluteFilePath();
> // check if we can begin processing the file
> try {
> final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
> boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
> if (!begin) {
> log.debug(endpoint + " cannot begin processing file: {}", file);
> // begin returned false, so remove file from the in progress list as its no longer in progress
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> } catch (Exception e) {
> if (log.isDebugEnabled()) {
> log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
> }
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> .
> .
> .
> .
> }
> {code}
> When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
> {noformat}
> 11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
> java.io.IOException: No space left on device
> at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
> at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
> at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
> at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
> at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
> {noformat}
> I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
Posted by "Claus Ibsen (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-5178:
-------------------------------
Issue Type: Improvement (was: Bug)
> "IOException: No space left on device" exception swallowed by camel
> -------------------------------------------------------------------
>
> Key: CAMEL-5178
> URL: https://issues.apache.org/jira/browse/CAMEL-5178
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.9.0, 2.9.1
> Reporter: Anders
>
> When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
> {code:title=GenericFileConsumer.java|borderStyle=solid}
> protected void processExchange(final Exchange exchange) {
> GenericFile<T> file = getExchangeFileProperty(exchange);
> log.trace("Processing file: {}", file);
> // must extract the absolute name before the begin strategy as the file could potentially be pre moved
> // and then the file name would be changed
> String absoluteFileName = file.getAbsoluteFilePath();
> // check if we can begin processing the file
> try {
> final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
> boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
> if (!begin) {
> log.debug(endpoint + " cannot begin processing file: {}", file);
> // begin returned false, so remove file from the in progress list as its no longer in progress
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> } catch (Exception e) {
> if (log.isDebugEnabled()) {
> log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
> }
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> .
> .
> .
> .
> }
> {code}
> When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
> {noformat}
> 11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
> java.io.IOException: No space left on device
> at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
> at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
> at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
> at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
> at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
> {noformat}
> I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-5178) "IOException: No space left on
device" exception swallowed by camel
Posted by "Claus Ibsen (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-5178.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.10.0
2.9.3
I improved this to propagate the exception to the org.apache.camel.spi.ExceptionHandler.
I wrote a FAQ
https://cwiki.apache.org/confluence/display/CAMEL/Why+do+my+file+consumer+not+pickup+the+file,+and+how+do+I+let+the+file+consumer+use+the+Camel+error+handler
And from the FAQ is a link to an example on the file page that shows how to do what you want.
> "IOException: No space left on device" exception swallowed by camel
> -------------------------------------------------------------------
>
> Key: CAMEL-5178
> URL: https://issues.apache.org/jira/browse/CAMEL-5178
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.9.0, 2.9.1
> Reporter: Anders
> Assignee: Claus Ibsen
> Fix For: 2.9.3, 2.10.0
>
>
> When routing a file using the GenericFileConsumer object an exception is swallowed if the lock file cant be created (i.e there is no harddrive space).
> {code:title=GenericFileConsumer.java|borderStyle=solid}
> protected void processExchange(final Exchange exchange) {
> GenericFile<T> file = getExchangeFileProperty(exchange);
> log.trace("Processing file: {}", file);
> // must extract the absolute name before the begin strategy as the file could potentially be pre moved
> // and then the file name would be changed
> String absoluteFileName = file.getAbsoluteFilePath();
> // check if we can begin processing the file
> try {
> final GenericFileProcessStrategy<T> processStrategy = endpoint.getGenericFileProcessStrategy();
> boolean begin = processStrategy.begin(operations, endpoint, exchange, file);
> if (!begin) {
> log.debug(endpoint + " cannot begin processing file: {}", file);
> // begin returned false, so remove file from the in progress list as its no longer in progress
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> } catch (Exception e) {
> if (log.isDebugEnabled()) {
> log.debug(endpoint + " cannot begin processing file: " + file + " due to: " + e.getMessage(), e);
> }
> endpoint.getInProgressRepository().remove(absoluteFileName);
> return;
> }
> .
> .
> .
> .
> }
> {code}
> When processStrategy.begin(operations, endpoint, exchange, file); throws an java.io.IOException this is swallowed in the catch method and never propagated to the error handling of camel. Output from log is:
> {noformat}
> 11:33:44.290 [Camel (camel-2) thread #1 - file:/Users/xxxx/yyyy/Files/] DEBUG o.a.c.component.file.FileConsumer - Endpoint[file:/Users/xxxx/yyyy/Files/] cannot begin processing file: GenericFile[//Users/xxxx/yyyy/Files/file01] due to: No space left on device
> java.io.IOException: No space left on device
> at java.io.UnixFileSystem.createFileExclusively(Native Method) ~[na:1.6.0_31]
> at java.io.File.createNewFile(File.java:883) ~[na:1.6.0_31]
> at org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock(MarkerFileExclusiveReadLockStrategy.java:54) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.begin(GenericFileProcessStrategySupport.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:46) ~[camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:308) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:175) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:136) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:140) [camel-core-2.9.0.jar:2.9.0]
> at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.9.0.jar:2.9.0]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_31]
> at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [na:1.6.0_31]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [na:1.6.0_31]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_31]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_31]
> at java.lang.Thread.run(Thread.java:680) [na:1.6.0_31]
> {noformat}
> I have tried both tried error handling on the route and the DefaultErrorHandler way but this exception is never handled by the methods, ie Camel log them and then swallow them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira