stillalex commented on code in PR #2101:
URL: https://github.com/apache/solr/pull/2101#discussion_r1424787277
##########
solr/core/src/java/org/apache/solr/core/SolrCore.java:
##########
@@ -1899,6 +1899,18 @@ public boolean isClosed() {
return refCount.get() <= 0;
}
+ /**
+ * Whether this core is ready. Sometimes using {@link #isClosed()} might
result in a deadlock due
+ * to the caller trying to eagerly open a new searcher via {@link
#withSearcher(IOFunction)}
+ * during core init phase.
+ *
+ * <p>Like for example concurrently polling metrics collection via the
registered gauges in {@link
+ * #initializeMetrics(SolrMetricsContext, String)}
+ */
+ public boolean isReady() {
+ return !isClosed() && newSearcherCounter.getCount() > 0;
Review Comment:
good catch
--
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]