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

Wenca Petr edited comment on SOLR-3011 at 3/2/12 9:47 AM:
----------------------------------------------------------

Well, I solved it. The problem was in EntityProcessorBase.getNext() method 
which set the rowIterator to null when it reached the end of data. Then the 
next thread called nextRow() on the SqlEntityProcessor instance where the code 
is:
{code}
if (rowIterator == null) {
    String q = getQuery();
    initQuery(context.replaceTokens(q));
}
{code}
So it reinitialized the query and created new row iterator from the beginning.
I am attaching a simple patch.

                
      was (Author: wenca):
    Well, I solved it. The problem was in EntityProcessorBase.getNext() method 
which set the rowIterator to null when it reached the end of data. Then the 
next thread called nextRow() on the SqlEntityProcessor instance where the code 
is:
{code:title=SqlEntityProcessor.nextRow()|borderStyle=solid}
if (rowIterator == null) {
    String q = getQuery();
    initQuery(context.replaceTokens(q));
}
{/code}
So it reinitialized the query and created new row iterator from the beginning.

I am attaching a simple patch.

                  
> DIH MultiThreaded bug
> ---------------------
>
>                 Key: SOLR-3011
>                 URL: https://issues.apache.org/jira/browse/SOLR-3011
>             Project: Solr
>          Issue Type: Sub-task
>          Components: contrib - DataImportHandler
>    Affects Versions: 3.5, 4.0
>            Reporter: Mikhail Khludnev
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: SOLR-3011.patch, SOLR-3011.patch, 
> patch-3011-EntityProcessorBase-iterator.patch
>
>
> current DIH design is not thread safe. see last comments at SOLR-2382 and 
> SOLR-2947. I'm going to provide the patch makes DIH core threadsafe. Mostly 
> it's a SOLR-2947 patch from 28th Dec. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

  • [jira] [Issue Comment Edite... Wenca Petr (Issue Comment Edited) (JIRA)

Reply via email to