dsmiley commented on code in PR #818:
URL: https://github.com/apache/solr/pull/818#discussion_r866276174


##########
solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java:
##########
@@ -274,6 +273,11 @@ public void writeResults(ResultContext ctx, JavaBinCodec 
codec) throws IOExcepti
         req.close();
         SolrRequestInfo.clearRequestInfo();
       }
+      // NOTE: `req` must be closed _before_ core, because `req` can hold a 
reference to
+      // SolrIndexSearcher which can in some cases block `core.close()` from 
completing
+      // successfully (by holding a reference to a core Directory). Hence we 
cannot trivially
+      // use try-with-resources to close `core`.
+      core.close();

Review Comment:
   Yes I agree; I think we should embrace try-with-resources as it provides 
structure.



-- 
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