[ 
https://issues.apache.org/jira/browse/LUCENE-5953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14203966#comment-14203966
 ] 

Uwe Schindler commented on LUCENE-5953:
---------------------------------------

I checked out: Also without this patch applied, TestReplicationHandlerBackup 
fails in 30% of all tries on Windows (on my machine). Error is always a 
NoSuchFileException when opening the IndexOutput for some index file on the 
snapshot directory - which disappeared in the meantime. This is seems to be 
caused by some deleting on the snapshot dirs in parallel. Looks like the test 
has problems:

{noformat}
   [junit4]   2> 7139 T27 oash.SnapShooter.createSnapshot Creating backup 
snapshot...
   [junit4]   2> 7149 T27 oash.SnapShooter.createSnapshot ERROR Exception while 
creating snapshot java.nio.file.NoSuchFileException: C:\Users\Uwe 
Schindler\Projects\lucene\trunk-lusolr1\solr\build\solr-core\test\J0\temp\solr.handler.TestReplicationHandlerBackup-B758CE1D69E0AEC1-001\solr-instance-001\collection1\data\snapshot.20141109154841694\_0.tip
   [junit4]   2>        at 
sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
   [junit4]   2>        at 
sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
   [junit4]   2>        at 
sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
   [junit4]   2>        at 
sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
   [junit4]   2>        at 
java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:430)
   [junit4]   2>        at java.nio.file.Files.newOutputStream(Files.java:172)
   [junit4]   2>        at 
org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:285)
   [junit4]   2>        at 
org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:220)
   [junit4]   2>        at 
org.apache.lucene.store.Directory.copy(Directory.java:150)
   [junit4]   2>        at 
org.apache.lucene.store.MockDirectoryWrapper.copy(MockDirectoryWrapper.java:1030)
   [junit4]   2>        at 
org.apache.solr.handler.SnapShooter.copyFile(SnapShooter.java:234)
   [junit4]   2>        at 
org.apache.solr.handler.SnapShooter.copyFiles(SnapShooter.java:229)
   [junit4]   2>        at 
org.apache.solr.handler.SnapShooter.createSnapshot(SnapShooter.java:139)
   [junit4]   2>        at 
org.apache.solr.handler.SnapShooter$1.run(SnapShooter.java:88)
   [junit4]   2>
   [junit4]   2> 7159 T22 C1 oasc.SolrCore.execute [collection1] webapp=/solr 
path=/replication params={command=details} status=0 QTime=10
   [junit4]   2> 7159 T12 oas.SolrTestCaseJ4.tearDown ###Ending doTestBackup
{noformat}

I see this unrelated to changes here - I just fixed the obsolete Locking on 
SnapShooter.java (it was unused), so I set NoLockFactory.INSTANCE on the 
Snapshot Directory instance.

> Refactor LockFactory usage in Directory
> ---------------------------------------
>
>                 Key: LUCENE-5953
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5953
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/store
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 5.0, Trunk
>
>         Attachments: LUCENE-5953.patch, LUCENE-5953.patch, LUCENE-5953.patch, 
> LUCENE-5953.patch, LUCENE-5953.patch
>
>
> We should remove the setters for the LockFactory from Directory and make the 
> field final. It is a bug to change the LockFactory after creating a 
> directory, because you may break locking (if locks are currently held).
> The LockFactory should be passed on ctor only.
> The other suggestion: Should LockFactory have a directory at all? We moved 
> away from having the lock separately from the index directory. This is no 
> longer a supported configuration (since approx Lucene 2.9 or 3.0). I would 
> like to remove the directory from LockFactory and make it part of the 
> Directory only.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to