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

Marc D'Mello commented on LUCENE-10077:
---------------------------------------

Hi, I would like to work on this issue.

> 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-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to