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

Henri Biestro commented on SOLR-647:
------------------------------------


Grant;
getCore() does not protect the core from being closed by another thread (it 
must either be protected by another mean or earlier or it does not matter).

For the other cases, calls should be used in pairs with the following 
convention; if you call an "open", you should call a "close", if you call an 
"acquire", you should call a "release".

openCore()/openAdminCore() do protect from the core from a // close and 
core.close() should be used to decrease the refcount.
acquireCore()/acquireAdminCore() use a SolrCore.Reference and decreasing the 
refcount should be done through the ref via ref.release().

The only difference between openCore()/close() or acquireCore()/release() is 
the usage of a reference which is just a convenience (at least to me: avoiding 
to test for null, assigning to final, etc).

Hope this makes sense.

> Do SolrCore.close() in a refcounted way
> ---------------------------------------
>
>                 Key: SOLR-647
>                 URL: https://issues.apache.org/jira/browse/SOLR-647
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Noble Paul
>            Assignee: Grant Ingersoll
>             Fix For: 1.3
>
>         Attachments: solr-647.patch, solr-647.patch, solr-647.patch, 
> solr-647.patch, solr-647.patch, SOLR-647.patch, SOLR-647.patch
>
>
> The method _SolrCore.close()_ directly closes the core . It can cause 
> Exceptions for in-flight requests. The _close()_ method should just do a 
> decrement on refcount and the actual close must happen when the last request 
> being processed by that core instance is completed

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to