camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-6069) java.io.IOException: Permission denied from MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock on NAS
Date Tue, 12 Feb 2013 08:31:12 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-6069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen updated CAMEL-6069:
-------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 2.11.0
                   2.10.4
                   2.9.6
    
> java.io.IOException: Permission denied from MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock
on NAS
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-6069
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6069
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.3
>            Reporter: Anders Holmgren
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.6, 2.10.4, 2.11.0
>
>
> We recently upgraded to 2.10.x and discovered that the file poller no longer works on
our NAS. We have hit similar issues with other open source libraries in the past.
> The problem occurs when MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock
is called and tries to create the new file. This actually works but also results in a Permission
denied IOException (strange but true). 
> A simple fix for this is to change the acquireExclusiveReadLock method as follows. 
> {code}
>     public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations,
>                                             GenericFile<File> file, Exchange exchange)
throws Exception {
>         String lockFileName = getLockFileName(file);
>         LOG.trace("Locking the file: {} using the lock file name: {}", file, lockFileName);
>         // create a plain file as marker filer for locking (do not use FileLock)
>         File lock = new File(lockFileName);
>         boolean acquired = false;
>         try
>         {
>             acquired = lock.createNewFile();
>         }
>         catch (IOException e)
>         {
>             if (lock.exists())
>             {
>                 acquired = true;
>             }
>             else
>             {
>                 throw e;
>             }
>         }
>         return acquired;
>     }
> {code}
> Note the same problem occurring with Spring Batch can be found [here|https://jira.springsource.org/browse/BATCH-1659]


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message