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

Marcel Reutegger commented on JCR-3466:
---------------------------------------

This is what happens:

- a thread triggers committing of pending changes in AbstractIndex.addDocument()
- the pooled threads start to invert the documents
- the calling thread is interrupted and does not clear the pending Map in 
VolatileIndex.commitPending()
- another thread will commit those pending documents again, but now the 
SingletonTokenStream in those documents may already be closed.

I think it would be better to wait for the CountDownLatch again even if the 
calling thread is interrupted.
                
> NPE in SingletonTokenStream
> ---------------------------
>
>                 Key: JCR-3466
>                 URL: https://issues.apache.org/jira/browse/JCR-3466
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.4
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>            Priority: Minor
>
> Occasionally I see a NPE in SingletonTokenStream when the thread triggering 
> the index update is interrupted:
> Exception in thread "DynamicPooledExecutor" java.lang.NullPointerException
>         at 
> org.apache.jackrabbit.core.query.lucene.SingletonTokenStream.incrementToken(SingletonTokenStream.java:89)
>         at 
> org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:141)
>         at 
> org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:276)
>         at 
> org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:766)
>         at 
> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2060)
>         at 
> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2034)
>         at 
> org.apache.jackrabbit.core.query.lucene.AbstractIndex$1.run(AbstractIndex.java:198)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to