[ https://issues.apache.org/jira/browse/SOLR-647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622618#action_12622618 ]
Yonik Seeley commented on SOLR-647: ----------------------------------- bq. refcount < 0 is an error . but should it throw an exception? I am not too sure. logging a severe error should be fine. because that should not be a reason to crash a server Right... on one hand an exception brings more visibility, but on the other hand it's a recoverable error that's not necessarily tied to the request that would get the exception. bq. even open() does not need a compareAndSet. just do a refCount.incrementAndget(). if count <=1 return null .because it is already closed or being closed . And then if another thread calls open() at the same time, count will be 2 and it would incorrectly return a closing core. If open() is needed, Henri has the right impl there. > 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: refcount_example.patch, solr-647.patch, solr-647.patch, > solr-647.patch, 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.