PavlidisLab / Gemma

Genomics data re-analysis
Apache License 2.0
23 stars 6 forks source link

Ontology index files are getting closed #1257

Closed arteymix closed 1 month ago

arteymix commented 1 month ago
Caused by: java.io.IOException: null: NIOFSIndexInput(path="/scratch/gemma/searchIndices/ontology/obiOntology.std/_1.tis")
        at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:180) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:270) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:40) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.DataInput.readVInt(DataInput.java:107) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.BufferedIndexInput.readVInt(BufferedIndexInput.java:217) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.TermBuffer.read(TermBuffer.java:64) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.SegmentTermEnum.next(SegmentTermEnum.java:133) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:174) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:202) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:172) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:539) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.TermQuery$TermWeight$1.add(TermQuery.java:56) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.util.ReaderUtil$Gather.run(ReaderUtil.java:81) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.util.ReaderUtil$Gather.run(ReaderUtil.java:87) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.util.ReaderUtil$Gather.run(ReaderUtil.java:87) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.util.ReaderUtil$Gather.run(ReaderUtil.java:70) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.TermQuery$TermWeight.<init>(TermQuery.java:53) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:199) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.BooleanQuery$BooleanWeight.<init>(BooleanQuery.java:176) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:354) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.Searcher.createNormalizedWeight(Searcher.java:168) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:664) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at ubic.basecode.ontology.jena.OntologyIndexer$LuceneSearchIndex.search(OntologyIndexer.java:321) ~[baseCode-1.1.23.jar:?]
        at ubic.basecode.ontology.jena.OntologyIndexer$LuceneSearchIndex.searchClasses(OntologyIndexer.java:304) ~[baseCode-1.1.23.jar:?]
        at ubic.basecode.ontology.jena.AbstractOntologyService.findTerm(AbstractOntologyService.java:390) ~[baseCode-1.1.23.jar:?]
        at ubic.basecode.ontology.providers.OntologyService.findTerm(OntologyService.java:224) ~[baseCode-1.1.23.jar:?]
        at ubic.gemma.core.ontology.OntologyCache.findTerm(OntologyCache.java:69) ~[gemma-core-1.31.12.jar:?]
        at ubic.gemma.core.ontology.OntologyServiceImpl.lambda$findTerms$2(OntologyServiceImpl.java:284) ~[gemma-core-1.31.12.jar:?]
        at ubic.gemma.core.ontology.OntologyServiceImpl.lambda$combineInThreads$21(OntologyServiceImpl.java:1111) ~[gemma-core-1.31.12.jar:?]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        ... 1 more
Caused by: java.nio.channels.ClosedChannelException
        at java.base/sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:150) ~[?:?]
        at java.base/sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:790) ~[?:?]
        at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:162) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:270) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:40) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.DataInput.readVInt(DataInput.java:107) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.store.BufferedIndexInput.readVInt(BufferedIndexInput.java:217) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
        at org.apache.lucene.index.TermBuffer.read(TermBuffer.java:64) ~[lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40]
arteymix commented 1 month ago

I think I figured it out. Our search threads are getting interrupted when the timeout of 30s is reached and that can cause the I/O channel to be closed.

A quick fix is to cancel the future without interrupting it.

Reference: https://issues.apache.org/jira/browse/LUCENE-7248

arteymix commented 1 month ago

The fix is rolled out. I'll monitor the issues over the upcoming week.

arteymix commented 1 month ago

Looks like it did the trick.