You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2015/01/14 14:46:34 UTC
[jira] [Comment Edited] (JENA-848) jena-text Lucene concurrency
issues
[ https://issues.apache.org/jira/browse/JENA-848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14276912#comment-14276912 ]
Andy Seaborne edited comment on JENA-848 at 1/14/15 1:46 PM:
-------------------------------------------------------------
I'm unclear from the description what happens if updates happen in a W transaction - is it effectively "read uncommitted" for the transaction? That isn't so bad as a robust query must check the datasets for any text index hits unless it knows more about the update patterns of the application. There is also a presumption about deletes not being supported; deletes aren't handled (and how need reference counting to be handled) IIRC.
was (Author: andy.seaborne):
I'm unclear from the description what happens if updates happen in a W transaction - is it effectively "read uncommitted" for the transaction? That isn't so bad as a robust query must check the datasets for any text index hits unless it knows more about the update patterns of the application.
> jena-text Lucene concurrency issues
> -----------------------------------
>
> Key: JENA-848
> URL: https://issues.apache.org/jira/browse/JENA-848
> Project: Apache Jena
> Issue Type: Bug
> Components: Text
> Reporter: Stephen Allen
> Assignee: Stephen Allen
>
> When using jena-text with an in-process Lucene index, there are concurrency issues when multiple requests are accessing the Dataset in using transactions.
> It appears the problem is that a new Lucene IndexWriter is created at every transaction start with no concurrency control. Instead the solution should be to create a single IndexWriter when the DatasetGraphText is created and use that for all requests. This works because the Lucene IndexWriter is thread safe and designed for concurrent access.
> This should also increase performance by not continually opening and closing the IndexWriter. Also we can use Near Real-Time (NRT) IndexReaders that don't have to wait until changes are pushed to disk.
> If concurrent access is not controlled then you can end up with IndexWriter objects being closed while they are still in use by other threads:
> {code}
> org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
> at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:645)
> at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:2974)
> at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2954)
> at org.apache.jena.query.text.TextIndexLucene.finishIndexing(TextIndexLucene.java:122)
> at org.apache.jena.query.text.TextDocProducerTriples.finish(TextDocProducerTriples.java:46)
> at org.apache.jena.query.text.DatasetGraphText.commit(DatasetGraphText.java:122)
> at org.apache.jena.query.text.TestLuceneWithMultipleThreads$2.run(TestLuceneWithMultipleThreads.java:156)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:744)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)