You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/02/21 18:56:11 UTC
[jira] [Commented] (CAMEL-8387) File consumer fails to acquire lock
if readLockTimeout >= readLockCheckInterval
[ https://issues.apache.org/jira/browse/CAMEL-8387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14330360#comment-14330360 ]
Claus Ibsen commented on CAMEL-8387:
------------------------------------
This is not a bug, you configure it wrong. But we can add a check that timeout must be < interval.
> File consumer fails to acquire lock if readLockTimeout >= readLockCheckInterval
> -------------------------------------------------------------------------------
>
> Key: CAMEL-8387
> URL: https://issues.apache.org/jira/browse/CAMEL-8387
> Project: Camel
> Issue Type: Improvement
> Affects Versions: 2.14.1
> Reporter: Christoffer Eide
> Priority: Minor
>
> If the {{readLockCheckInterval}} is greater than or equal to {{readLockTimeout}} when using {{readLock=changed}}, the consumer never picks up any files.
> So this URI will triggers the behaviour:
> {{file:some-folder?readLock=changed&readLockCheckInterval=1000&readLockTimeout=500}}
> The problem is that {{FileChangedExclusiveReadLockStrategy}} only takes {{readLockTimeout}} into account.
> 1. {{FileChangedExclusiveReadLockStrategy}} get the last modified and size of the file.
> 2. It sleeps for the duration configured in {{readLockCheckInterval}}
> 3. Now the timeout configured in {{readLockTimeout}} is exceeded, so {{FileChangedExclusiveReadLockStrategy}} logs "Cannot acquire read lock within.." and returns false
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)