dsmiley commented on a change in pull request #376:
URL: https://github.com/apache/solr/pull/376#discussion_r747845732



##########
File path: solr/core/src/java/org/apache/solr/request/SolrRequestInfo.java
##########
@@ -95,25 +99,33 @@ public static void clearRequestInfo() {
    * we expect it to be empty by now because all "set" calls need to be 
balanced with a "clear".
    */
   public static void reset() {
+    log.trace("reset()");
     Deque<SolrRequestInfo> stack = threadLocal.get();
-    boolean isEmpty = stack.isEmpty();
+    assert stack.isEmpty() : "SolrRequestInfo Stack should have been cleared.";
     while (!stack.isEmpty()) {
       SolrRequestInfo info = stack.pop();
-      closeHooks(info);
+      info.close();
     }
-    assert isEmpty : "SolrRequestInfo Stack should have been cleared.";
   }
 
-  private static void closeHooks(SolrRequestInfo info) {
-    if (info.closeHooks != null) {
-      for (Closeable hook : info.closeHooks) {
+  private synchronized void close() {

Review comment:
       I think it should be the whole method -- for the refCount & closeHook 
manipulation.  Besides; it shouldn't be contented.




-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to