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

Michael McCandless commented on LUCENE-7527:
--------------------------------------------

This can happen if your application mis-uses the {{IndexReader}} lifecycle by 
closing an {{IndexReader}} while searches are still running.

Triple check all your code to make sure you always {{acquire}} a searcher from 
{{SearcherManager}} and then always release it, only once, via {{release}}, and 
that you never directly close a searcher (just the {{SearcherManager}} once all 
searching is finished).

Though it is odd you hit it inside {{cleanMapping}}.

You could also try switching to {{NIOFSDirectory}} ... performance may be worse 
in some cases, but maybe it'll throw {{AlreadyClosedException}} instead of 
crashing your JVM.

Also, 3.5 is really ancient at this point.  It could be you are hitting an 
already fixed bug.

> Facing unsafe memory access operation error while calling 
> searcherManager.maybeReopen()
> ---------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7527
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7527
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/search
>    Affects Versions: 3.5
>            Reporter: Jagmohan Singh
>
> We are getting below error while calling searcherManager.maybeReopen() 
> method. We are using MMAP implementation to read NFS index directory mounted 
> against 3 servers. We have a different process to update the indices and 3 
> other processes to read from the same index. What we believe is that this 
> issue occurs when we call maybeReopen() method during heavy writes to the 
> indices and MMap implementation is not able to coop with it..
> Caused by: java.lang.InternalError: a fault occurred in a recent unsafe 
> memory access operation in compiled Java code
>         at java.security.AccessController.doPrivileged(Native Method)
>         at 
> org.apache.lucene.store.MMapDirectory.cleanMapping(MMapDirectory.java:158)
>         at 
> org.apache.lucene.store.MMapDirectory$MMapIndexInput.close(MMapDirectory.java:389)
>         at 
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:690)
>         at 
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:593)
>         at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:359)
>         at 
> org.apache.lucene.index.SegmentInfos.readCurrentVersion(SegmentInfos.java:480)
>         at 
> org.apache.lucene.index.DirectoryReader.isCurrent(DirectoryReader.java:901)
>         at 
> org.apache.lucene.index.DirectoryReader.doOpenNoWriter(DirectoryReader.java:471)
>         at 
> org.apache.lucene.index.DirectoryReader.doOpenIfChanged(DirectoryReader.java:450)
>         at 
> org.apache.lucene.index.DirectoryReader.doOpenIfChanged(DirectoryReader.java:391)
>         at 
> org.apache.lucene.index.IndexReader.openIfChanged(IndexReader.java:497)
>         at 
> org.apache.lucene.search.SearcherManager.maybeReopen(SearcherManager.java:162)



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

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

Reply via email to