camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maria Iracheta (JIRA)" <>
Subject [jira] [Updated] (CAMEL-3789) org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy is not thread-safe
Date Tue, 22 Mar 2011 14:42:05 GMT


Maria Iracheta updated CAMEL-3789:


Junit class to test the MarkerFileExclusiveReadLockStrategy in a multithreaded scenario

> org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy is not thread-safe
> -----------------------------------------------------------------------------------------------
>                 Key: CAMEL-3789
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Maria Iracheta
>         Attachments:,,,,
> MarkerFileExclusiveReadLockStrategy is not thread-safe. When I run  a File endpoint with
more than one thread the MarkerFileExclusiveReadLockStrategy only deletes the last file to
start being processed. 
> The MarkerFileExclusiveReadLockStrategy uses global variables: 
> private File lock; 
> private String lockFileName; 
> and gives them values on the acquireExclusiveReadLock method. When another thread calls
the releaseExclusiveReadLock method it uses the global variables to delete the locked file.
That means that if another thread came and called the acquireExclusiveReadLock it would have
changed the values on the global variables. 
> If lock and lockFileName are not global variables the problem seems to disappear and
I can a multithreaded File endpoint and not locked file is left undeleted. 

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message