You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2014/03/16 05:48:56 UTC

[jira] [Updated] (LUCENE-3266) Improve FileLocking based on Java 1.6

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

David Smiley updated LUCENE-3266:
---------------------------------

    Fix Version/s:     (was: 4.7)
                   4.8

> Improve FileLocking based on Java 1.6 
> --------------------------------------
>
>                 Key: LUCENE-3266
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3266
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/store
>    Affects Versions: 4.0-ALPHA
>            Reporter: Simon Willnauer
>            Priority: Minor
>             Fix For: 4.8
>
>
> Snippet from NativeFSLockFactory:
> {noformat}
> /*
> * The javadocs for FileChannel state that you should have
> * a single instance of a FileChannel (per JVM) for all
> * locking against a given file (locks are tracked per 
> * FileChannel instance in Java 1.4/1.5). Even using the same 
> * FileChannel instance is not completely thread-safe with Java 
> * 1.4/1.5 though. To work around this, we have a single (static) 
> * HashSet that contains the file paths of all currently 
> * locked locks.  This protects against possible cases 
> * where different Directory instances in one JVM (each 
> * with their own NativeFSLockFactory instance) have set 
> * the same lock dir and lock prefix. However, this will not 
> * work when LockFactorys are created by different 
> * classloaders (eg multiple webapps). 
> * 
> * TODO: Java 1.6 tracks system wide locks in a thread safe manner 
> * (same FileChannel instance or not), so we may want to 
> * change this when Lucene moves to Java 1.6.
> */
> {noformat}
> since we are on 1.6 we should improve this if possible.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org