You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Bin Lan <bl...@perimeterusa.com> on 2012/11/08 15:39:57 UTC
AlreadyClosedException when doing search
We recently upgrade our lucene library from 1.9.1 to 3.6.1 and we run into
multiple AlreadyClosedException when doing search. Here is the stack:
RetrievedDateMarker=2012-11-08 08:36:34.393 Error searching
\\p7na02b\na01_mail03\index\daily\20121031.main.index.3
com.seccas.task.SearchRequestTask.futureTaskRun(
SearchRequestTask.java:136)
com.seccas.util.SearchThread.run(SearchThread.java:26)
Caused by:
org.apache.lucene.store.AlreadyClosedException: MMapIndexInput already
closed: MMapIndexInput(path="\\p7na02b\na01_mail03\
compliance.farmersagent.com\index\daily\20121031.main.index.3\_4ljc.frq")
org.apache.lucene.store.MMapDirectory$MMapIndexInput.seek(MMapDirectory.java:382)
org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:100)
org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:67)
com.seccas.lucene.FieldArrayFilter.getDocIdSet(FieldArrayFilter.java:157)
org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:136)
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:364)
com.seccas.task.SearchRequestTask.futureTaskRun(
SearchRequestTask.java:89)
com.seccas.util.SearchThread.run(SearchThread.java:26)
On the source code side, we open and did the search like this:
reader = IndexReader.open(FSDirectory.open(newFile(request.indexPath)));
searcher = new IndexSearcher( reader );
searcher.search( query, filter, collector );
I do not see any reason why this could happen. The IndexReader is not being
shared with other thread.
Regards
--
Bin Lan
Software Developer
Perimeter E-Security
O - (203)541-3412
Follow Us on Twitter: www.twitter.com/PerimeterNews
Read Our Blog: security.perimeterusa.com/blog
--
The sender of this email subscribes to Perimeter E-Security's email
anti-virus service. This email has been scanned for malicious code and is
believed to be virus free. For more information on email security please
visit: http://www.perimeterusa.com/services/messaging
This communication is confidential, intended only for the named recipient(s)
above and may contain trade secrets or other information that is exempt from
disclosure under applicable law. Any use, dissemination, distribution or
copying of this communication by anyone other than the named recipient(s) is
strictly prohibited. If you have received this communication in error, please
delete the email and immediately notify our Command Center at 203-541-3444.
Re: AlreadyClosedException when doing search
Posted by Bin Lan <bl...@perimeterusa.com>.
Hi Ian,
Thank you, figure it out last night a piece legacy code closes the TermDoc
in every loop. Somehow the old version was fine with it.
Regards
--
Bin Lan
Software Developer
Perimeter E-Security
O - (203)541-3412
Follow Us on Twitter: www.twitter.com/PerimeterNews
Read Our Blog: security.perimeterusa.com/blog
On Fri, Nov 9, 2012 at 5:09 AM, Ian Lea <ia...@gmail.com> wrote:
> By far the most likely cause is that something somewhere in your code
> is closing the searcher or the reader.
>
>
> --
> Ian.
>
>
> On Thu, Nov 8, 2012 at 2:39 PM, Bin Lan <bl...@perimeterusa.com> wrote:
> > We recently upgrade our lucene library from 1.9.1 to 3.6.1 and we run
> into
> > multiple AlreadyClosedException when doing search. Here is the stack:
> >
> > RetrievedDateMarker=2012-11-08 08:36:34.393 Error searching
> > \\p7na02b\na01_mail03\index\daily\20121031.main.index.3
> > com.seccas.task.SearchRequestTask.futureTaskRun(
> > SearchRequestTask.java:136)
> > com.seccas.util.SearchThread.run(SearchThread.java:26)
> > Caused by:
> > org.apache.lucene.store.AlreadyClosedException: MMapIndexInput already
> > closed: MMapIndexInput(path="\\p7na02b\na01_mail03\
> > compliance.farmersagent.com
> \index\daily\20121031.main.index.3\_4ljc.frq")
> >
> >
> org.apache.lucene.store.MMapDirectory$MMapIndexInput.seek(MMapDirectory.java:382)
> >
> > org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:100)
> >
> > org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:67)
> >
> > com.seccas.lucene.FieldArrayFilter.getDocIdSet(FieldArrayFilter.java:157)
> >
> >
> org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:136)
> >
> > org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
> >
> > org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:364)
> > com.seccas.task.SearchRequestTask.futureTaskRun(
> > SearchRequestTask.java:89)
> > com.seccas.util.SearchThread.run(SearchThread.java:26)
> >
> > On the source code side, we open and did the search like this:
> >
> > reader = IndexReader.open(FSDirectory.open(newFile(request.indexPath)));
> > searcher = new IndexSearcher( reader );
> > searcher.search( query, filter, collector );
> >
> > I do not see any reason why this could happen. The IndexReader is not
> being
> > shared with other thread.
> >
> > Regards
> > --
> > Bin Lan
> > Software Developer
> > Perimeter E-Security
> > O - (203)541-3412
> >
> > Follow Us on Twitter: www.twitter.com/PerimeterNews
> > Read Our Blog: security.perimeterusa.com/blog
> >
> >
> >
> >
> > --
> > The sender of this email subscribes to Perimeter E-Security's email
> > anti-virus service. This email has been scanned for malicious code and
> is
> > believed to be virus free. For more information on email security please
> > visit: http://www.perimeterusa.com/services/messaging
> > This communication is confidential, intended only for the named
> recipient(s)
> > above and may contain trade secrets or other information that is exempt
> from
> > disclosure under applicable law. Any use, dissemination, distribution or
> > copying of this communication by anyone other than the named
> recipient(s) is
> > strictly prohibited. If you have received this communication in error,
> please
> > delete the email and immediately notify our Command Center at
> 203-541-3444.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
--
The sender of this email subscribes to Perimeter E-Security's email
anti-virus service. This email has been scanned for malicious code and is
believed to be virus free. For more information on email security please
visit: http://www.perimeterusa.com/services/messaging
This communication is confidential, intended only for the named recipient(s)
above and may contain trade secrets or other information that is exempt from
disclosure under applicable law. Any use, dissemination, distribution or
copying of this communication by anyone other than the named recipient(s) is
strictly prohibited. If you have received this communication in error, please
delete the email and immediately notify our Command Center at 203-541-3444.
Re: AlreadyClosedException when doing search
Posted by Ian Lea <ia...@gmail.com>.
By far the most likely cause is that something somewhere in your code
is closing the searcher or the reader.
--
Ian.
On Thu, Nov 8, 2012 at 2:39 PM, Bin Lan <bl...@perimeterusa.com> wrote:
> We recently upgrade our lucene library from 1.9.1 to 3.6.1 and we run into
> multiple AlreadyClosedException when doing search. Here is the stack:
>
> RetrievedDateMarker=2012-11-08 08:36:34.393 Error searching
> \\p7na02b\na01_mail03\index\daily\20121031.main.index.3
> com.seccas.task.SearchRequestTask.futureTaskRun(
> SearchRequestTask.java:136)
> com.seccas.util.SearchThread.run(SearchThread.java:26)
> Caused by:
> org.apache.lucene.store.AlreadyClosedException: MMapIndexInput already
> closed: MMapIndexInput(path="\\p7na02b\na01_mail03\
> compliance.farmersagent.com\index\daily\20121031.main.index.3\_4ljc.frq")
>
> org.apache.lucene.store.MMapDirectory$MMapIndexInput.seek(MMapDirectory.java:382)
>
> org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:100)
>
> org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:67)
>
> com.seccas.lucene.FieldArrayFilter.getDocIdSet(FieldArrayFilter.java:157)
>
> org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:136)
>
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577)
>
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:364)
> com.seccas.task.SearchRequestTask.futureTaskRun(
> SearchRequestTask.java:89)
> com.seccas.util.SearchThread.run(SearchThread.java:26)
>
> On the source code side, we open and did the search like this:
>
> reader = IndexReader.open(FSDirectory.open(newFile(request.indexPath)));
> searcher = new IndexSearcher( reader );
> searcher.search( query, filter, collector );
>
> I do not see any reason why this could happen. The IndexReader is not being
> shared with other thread.
>
> Regards
> --
> Bin Lan
> Software Developer
> Perimeter E-Security
> O - (203)541-3412
>
> Follow Us on Twitter: www.twitter.com/PerimeterNews
> Read Our Blog: security.perimeterusa.com/blog
>
>
>
>
> --
> The sender of this email subscribes to Perimeter E-Security's email
> anti-virus service. This email has been scanned for malicious code and is
> believed to be virus free. For more information on email security please
> visit: http://www.perimeterusa.com/services/messaging
> This communication is confidential, intended only for the named recipient(s)
> above and may contain trade secrets or other information that is exempt from
> disclosure under applicable law. Any use, dissemination, distribution or
> copying of this communication by anyone other than the named recipient(s) is
> strictly prohibited. If you have received this communication in error, please
> delete the email and immediately notify our Command Center at 203-541-3444.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org