diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java index cfd9836c4ed..36ba8694cf9 100644 --- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java +++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java @@ -49,6 +49,7 @@ import org.apache.solr.common.util.SuppressForbidden; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.NodeRoles; +import org.apache.solr.core.SolrCore; import org.apache.solr.handler.api.V2ApiUtils; import org.apache.solr.logging.MDCLoggingContext; import org.apache.solr.logging.MDCSnapshot; @@ -275,6 +276,18 @@ private void dispatch( } } finally { call.destroy(); + SolrCore core = call.getCore(); + if (core != null) { + int coreRefCount = core.getOpenCount(); + if (coreRefCount > 1) { + if (log.isInfoEnabled()) + log.info( + "Core {} has ref count of {} . It's still used by other logic even if the current servlet request {} finishes", + core.getName(), + coreRefCount, + call.getReq().getServletPath()); + } + } ExecutorUtil.setServerThreadFlag(null); } }