dsmiley commented on PR #2101:
URL: https://github.com/apache/solr/pull/2101#issuecomment-1843768954

   Thanks for clarifying Andreas.  I propose initializing metrics at the very 
end of the constructor, which is when we can say the SolrCore is reasonably 
constructed.
   
   > simply moving the code would not provide a stronger guarantee.
   
   Guarantee of what?  Maybe you mean guarantee that there isn't some indirect 
call via SolrCore that isn't immediately obvious but registers metrics that 
might need a Searcher?  Okay.
   
   > delaying the metrics was what I was going for. but would we need to delay 
all metrics or just the problematic ones?
   
   The calls to initializeMetrics() both on SolrCore and on solrFieldCacheBean.
   
   The CountDownLatch "latch" in the constructor is interesting; notice it's 
closed at the very end.  "latch" was a poor name; ambiguous (it's like calling 
an int "integer").  We might generalize that slightly to a field that conveys 
the state of the SolrCore being constructed.  Call it "constructedLatch".  Then 
gate the metrics gauges on that & (and !closed) instead of refCount. I don't 
understand how `refCount <= 1` is a solution; there can be many simultaneous 
references (say 10) and we should expose values then.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to