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


##########
solr/core/src/java/org/apache/solr/handler/admin/RequestApplyUpdatesOp.java:
##########
@@ -67,6 +69,11 @@ public void execute(CoreAdminHandler.CallInfo it) throws 
Exception {
             SolrException.ErrorCode.SERVER_ERROR, "Could not apply buffered 
updates", e);
     } finally {
       if (it.req != null) it.req.close();
+      // 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`.

Review Comment:
   I think I'd use nested `try w/ resources` for SolrCore and inner 
`try/finally` for `it.req` that would force the order as well and make it more 
clear?



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