[
https://issues.apache.org/jira/browse/OAK-9561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17410929#comment-17410929
]
Nitin Gupta commented on OAK-9561:
----------------------------------
This code here
[https://github.com/oak-indexing/jackrabbit-oak/blob/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DelayedFacetReadTest.java#L116#L120]
{code:java}
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
{code}
should effectively make the main thread wait till the async thread is completed
and not call the NRTIndex.close till then. So from timing perspective, I think
this should work fine.
But I am not sure if there is certain logic during increment/decrement of
refCount where we have a stray refcount someplace that is not decremented - but
unable to figure out even if there is, why would that prop up only
intermittently.
cc : [~tihom88] [~thomasm]
> Flaky test: DelayedFacetReadTest.facet
> ---------------------------------------
>
> Key: OAK-9561
> URL: https://issues.apache.org/jira/browse/OAK-9561
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: indexing, query
> Reporter: Thomas Mueller
> Assignee: Nitin Gupta
> Priority: Major
>
> Sometimes we see:
> {noformat}
> Error Message
> Unclosed reader found with refCount 1 for index /oak:index/hybridtest
> (nrt1629897373046)
> Stacktrace
> java.lang.IllegalStateException: Unclosed reader found with refCount 1 for
> index /oak:index/hybridtest (nrt1629897373046)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndex.assertAllReadersAreClosed(NRTIndex.java:270)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndex.close(NRTIndex.java:204)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndexFactory.close(NRTIndexFactory.java:100)
> at
> org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.DelayedFacetReadTest.tearDown(DelayedFacetReadTest.java:121)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)