Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on get searcher from Lucene index. java.lang.IllegalStateException: The managed reference has already closed - this is likely a bug when the reference count is modified outside of the ReferenceManager #8832

Closed
petervavro opened this issue Apr 1, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@petervavro
Copy link

OrientDB Version: v3.0.17

Java Version: "11" 2018-09-25

OS: MacOS 10.14.3

Actual behavior

OrientDB server restart required to solve the issue.

$ANSI{green {db=some}} Error on get searcher from Lucene index
java.lang.IllegalStateException: The managed reference has already closed - this is likely a bug when the reference count is modified outside of the ReferenceManager
	at org.apache.lucene.search.ReferenceManager.acquire(ReferenceManager.java:114)
	at com.orientechnologies.lucene.engine.OLuceneIndexEngineAbstract.searcher(OLuceneIndexEngineAbstract.java:422)
	at com.orientechnologies.lucene.engine.OLuceneFullTextIndexEngine.getResults(OLuceneFullTextIndexEngine.java:191)
	at com.orientechnologies.lucene.engine.OLuceneFullTextIndexEngine.getInTx(OLuceneFullTextIndexEngine.java:280)
	at com.orientechnologies.lucene.engine.OLuceneFullTextIndexEngine.get(OLuceneFullTextIndexEngine.java:140)
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doGetIndexValue(OAbstractPaginatedStorage.java:2684)
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.getIndexValue(OAbstractPaginatedStorage.java:2665)
	at com.orientechnologies.lucene.index.OLuceneIndexNotUnique.get(OLuceneIndexNotUnique.java:275)
	at com.orientechnologies.lucene.functions.OLuceneSearchOnClassFunction.searchFromTarget(OLuceneSearchOnClassFunction.java:128)
	at com.orientechnologies.orient.core.sql.parser.OFunctionCall.executeIndexedFunction(OFunctionCall.java:169)
	at com.orientechnologies.orient.core.sql.parser.OLevelZeroIdentifier.executeIndexedFunction(OLevelZeroIdentifier.java:96)
	at com.orientechnologies.orient.core.sql.parser.OBaseIdentifier.executeIndexedFunction(OBaseIdentifier.java:104)
	at com.orientechnologies.orient.core.sql.parser.OBaseExpression.executeIndexedFunction(OBaseExpression.java:165)
	at com.orientechnologies.orient.core.sql.parser.OExpression.executeIndexedFunction(OExpression.java:299)
	at com.orientechnologies.orient.core.sql.parser.OBinaryCondition.executeIndexedFunction(OBinaryCondition.java:137)
	at com.orientechnologies.orient.core.sql.executor.FetchFromIndexedFunctionStep.init(FetchFromIndexedFunctionStep.java:100)
	at com.orientechnologies.orient.core.sql.executor.FetchFromIndexedFunctionStep.syncPull(FetchFromIndexedFunctionStep.java:38)
	at com.orientechnologies.orient.core.sql.executor.FilterByClustersStep$1.fetchNextItem(FilterByClustersStep.java:57)
	at com.orientechnologies.orient.core.sql.executor.FilterByClustersStep$1.hasNext(FilterByClustersStep.java:93)
	at com.orientechnologies.orient.core.sql.executor.FilterByClassStep$1.fetchNextItem(FilterByClassStep.java:50)
	at com.orientechnologies.orient.core.sql.executor.FilterByClassStep$1.hasNext(FilterByClassStep.java:88)
	at com.orientechnologies.orient.core.sql.executor.ProjectionCalculationStep$1.hasNext(ProjectionCalculationStep.java:33)
	at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.fetchNext(OLocalResultSet.java:36)
	at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.<init>(OLocalResultSet.java:29)
	at com.orientechnologies.orient.core.sql.parser.OSelectStatement.execute(OSelectStatement.java:285)
	at com.orientechnologies.orient.core.command.OSqlScriptExecutor.execute(OSqlScriptExecutor.java:71)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.execute(ODatabaseDocumentEmbedded.java:634)
	at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeQuery(OConnectionBinaryExecutor.java:1297)
	at com.orientechnologies.orient.client.remote.message.OQueryRequest.execute(OQueryRequest.java:133)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:304)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:206)
	at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)

Steps to reproduce

It occurs randomly. I am not able to share the query with you but interesting thing is that it does not contain "SEARCH CLASS" so I don't understand why is it happening.

@wolf4ood
Copy link
Member

wolf4ood commented Apr 2, 2019

Hi @petervavro

is this happening after x time?

are you doing the filter field lucene something ?

Thanks

@wolf4ood wolf4ood self-assigned this Apr 2, 2019
@petervavro
Copy link
Author

Hi,

Yesterday I found out the query which causing it :

SELECT fieldA, @rid AS id, fieldC:{
      @rid AS fieldCId
    } FROM TableA WHERE SEARCH_CLASS("tex*")=TRUE

Class definition :

CREATE CLASS TableA IF NOT EXISTS EXTENDS V;
CREATE PROPERTY TableA.fieldA STRING;
ALTER PROPERTY  TableA.fieldA COLLATE "ci";
CREATE PROPERTY  TableA.fieldB STRING;
ALTER PROPERTY  TableA.fieldB COLLATE "ci";
CREATE PROPERTY  TableA.fieldC LINK TableB;
CREATE index TableA.fieldA ON Place(name) FULLTEXT ENGINE LUCENE METADATA { "analyzer": "org.apache.lucene.analysis.es.SpanishAnalyzer", "default": "org.apache.lucene.analysis.es.SpanishAnalyzer" };

@wolf4ood
Copy link
Member

wolf4ood commented Apr 3, 2019

Hi @petervavro

i was able to reproduce this. I'm working on a fix

Thanks

wolf4ood added a commit that referenced this issue Apr 4, 2019
@wolf4ood
Copy link
Member

wolf4ood commented Apr 4, 2019

Hi @petervavro

i've just pushed a fix for this. It will be available in the next release

Thanks

@wolf4ood wolf4ood added the bug label Apr 4, 2019
@wolf4ood wolf4ood added this to the 3.0.19 milestone Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants