You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Marc D'Mello (Jira)" <ji...@apache.org> on 2021/09/01 18:31:00 UTC

[jira] [Comment Edited] (LUCENE-10077) Closing the DirTaxonomyReader while another thread access the cache can throw NPE

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

Marc D'Mello edited comment on LUCENE-10077 at 9/1/21, 6:30 PM:
----------------------------------------------------------------

Since the results in this [JIRA|https://issues.apache.org/jira/browse/LUCENE-10068?focusedCommentId=17407758&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17407758] suggest that the cache might not be doing as good of a job as we thought it was, it might get removed. I'll get back to this issue in a few days.


was (Author: mdmarshmallow):
Since the results in this JIRA suggest that the cache might not be doing as good of a job as we thought it was, it might get removed. I'll get back to this issue in a few days.

> Closing the DirTaxonomyReader while another thread access the cache can throw NPE
> ---------------------------------------------------------------------------------
>
>                 Key: LUCENE-10077
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10077
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>    Affects Versions: main (9.0)
>            Reporter: Gautam Worah
>            Priority: Minor
>
> When we close a {{DirectoryTaxonomyReader}} in {{doClose}}, we set the {{categoryCache}} to null. But if a thread is next after this {{doClose}} call, it will still try to acquire a lock and {{synchronize}} on it. This will result in an NPE.
> This works well today, because we operate on the assumption that the user will always call {{doClose}} after all threads have completed. 
>  One suggestion by [~mikemccand] in this [PR|https://github.com/apache/lucene/pull/179#discussion_r697880516] was to make categoryCache final and throw an AlreadyClosedException.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org