I may be way off here, but with the changes made to support multiple cores, isn't there a possible race condition in the default single core situation between the assignment to "private static SolrCore instance" in SolrCore.getSolrCore() and the SolrCore constructor?

Consider the case where legacy code calls SolrCore.getSolrCore() while another thread is in the middle of executing the SolrCore constructor (either directly, or because it called to getSolrCore()) ... won't it have access to a "partially constructed" core before all of the initialization is complete?

It seems like either...

1) getSolrCore() should also synchronize on SolrCore.class
...OR...
2) SolrCore(...) should not include the "instance = this" line, we put the synchronization block back into getSolrCore() and make it the only place instance is assigned ... change it's documentation to make it clear that it generates a new "anonymouns" SolrCore the first time it's called and allways returns that same SolrCore


does that make sense?


(forgive me if i'm way off base and this is something that was allready thoroughly discussed in the multi-core bugs/threads ... i wasn't able to followthem that closely and only stumbled upon this while looking at something else)


-Hoss

Reply via email to