Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6692C200BD3 for ; Tue, 6 Dec 2016 12:12:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 639A7160B0C; Tue, 6 Dec 2016 11:12:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B3CD7160B29 for ; Tue, 6 Dec 2016 12:12:23 +0100 (CET) Received: (qmail 40890 invoked by uid 500); 6 Dec 2016 11:11:31 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 37497 invoked by uid 99); 6 Dec 2016 11:11:29 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2016 11:11:29 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 638B62C03E7 for ; Tue, 6 Dec 2016 11:11:29 +0000 (UTC) Date: Tue, 6 Dec 2016 11:11:29 +0000 (UTC) From: "Uwe Schindler (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENE-7582) NIOFSDirectory sometime doesn't work on windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 06 Dec 2016 11:12:24 -0000 [ https://issues.apache.org/jira/browse/LUCENE-7582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15724990#comment-15724990 ] Uwe Schindler commented on LUCENE-7582: --------------------------------------- Hi, use FSDirectory.open static factory. It will choose the best implementation automatically depending on Operating System. On Windows this will choose MMapDircetory for 64 bit platforms and SimpleFSDirectory on 32 bit platforms. This is perfectly fine. Keep in min that SImpleFSDirectory is not "slow" , it just does not perform well in multithreaded environments (many parallel searches). But on 32 bit platforms it is unlikely that you have many parallel searches! 32 bit VMs are mostly used for stuff like local mail search engines or other pure client/GUI apps. Async FileChannel does not work and slows down immense for synchronous IO like Lucene does, because you need additional client code synchronization. It gets like 2 times slower than SimpleFSDirectory. > NIOFSDirectory sometime doesn't work on windows > ----------------------------------------------- > > Key: LUCENE-7582 > URL: https://issues.apache.org/jira/browse/LUCENE-7582 > Project: Lucene - Core > Issue Type: Bug > Components: core/store > Affects Versions: 5.3.1 > Environment: Windows 10, 32 bits JVM > Reporter: Kevin Senechal > > Hi! > I've an error using lucene on windows. I already post a question on modeshape forum (https://developer.jboss.org/thread/273070) and it looks that NIOFSDirectory is not working well on windows as described in the java documentation of this class. > {quote}NOTE: NIOFSDirectory is not recommended on Windows because of a bug in how FileChannel.read is implemented in Sun's JRE. Inside of the implementation the position is apparently synchronized. See here for details.{quote} > After reading the linked java issue (http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6265734), it seems that there is a workaround to solve it, use an AsynchronousFileChannel. > Is it a choice that has been made to not use AsynchronousFileChannel or will it be a good fix? > You'll find the complete stacktrace below: > {code:java} > Caused by: org.modeshape.jcr.index.lucene.LuceneIndexException: Cannot commit index writer > at org.modeshape.jcr.index.lucene.LuceneIndex.commit(LuceneIndex.java:155) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.spi.index.provider.IndexChangeAdapter.completeWorkspaceChanges(IndexChangeAdapter.java:104) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.cache.change.ChangeSetAdapter.notify(ChangeSetAdapter.java:157) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.spi.index.provider.IndexProvider$AtomicIndex.notify(IndexProvider.java:1493) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.bus.RepositoryChangeBus.notify(RepositoryChangeBus.java:190) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.cache.document.WorkspaceCache.changed(WorkspaceCache.java:333) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.txn.SynchronizedTransactions.updateCache(SynchronizedTransactions.java:223) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:751) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.JcrSession.save(JcrSession.java:1171) ~[dsdk-launcher.jar:na] > ... 19 common frames omitted > Caused by: java.nio.file.FileSystemException: C:\Users\Christopher\Infiltrea3CLOUDTEST8\christopher@dooapp.com\indexes\default\nodesByPath\_dc_Lucene50_0.doc: The process cannot access the file because it is being used by another process. > at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) ~[na:1.8.0_92] > at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[na:1.8.0_92] > at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[na:1.8.0_92] > at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115) ~[na:1.8.0_92] > at java.nio.channels.FileChannel.open(FileChannel.java:287) ~[na:1.8.0_92] > at java.nio.channels.FileChannel.open(FileChannel.java:335) ~[na:1.8.0_92] > at org.apache.lucene.util.IOUtils.fsync(IOUtils.java:393) ~[dsdk-launcher.jar:na] > at org.apache.lucene.store.FSDirectory.fsync(FSDirectory.java:281) ~[dsdk-launcher.jar:na] > at org.apache.lucene.store.FSDirectory.sync(FSDirectory.java:226) ~[dsdk-launcher.jar:na] > at org.apache.lucene.store.LockValidatingDirectoryWrapper.sync(LockValidatingDirectoryWrapper.java:62) ~[dsdk-launcher.jar:na] > at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4456) ~[dsdk-launcher.jar:na] > at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:2874) ~[dsdk-launcher.jar:na] > at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:2977) ~[dsdk-launcher.jar:na] > at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2944) ~[dsdk-launcher.jar:na] > at org.modeshape.jcr.index.lucene.LuceneIndex.commit(LuceneIndex.java:152) ~[dsdk-launcher.jar:na] > {code} > Thank you in advance for your help -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org