cpoerschke commented on code in PR #794: URL: https://github.com/apache/solr/pull/794#discussion_r846120531
########## solr/core/src/java/org/apache/solr/handler/IndexFetcher.java: ########## @@ -1014,8 +1014,10 @@ private void openNewSearcherAndUpdateCommitPoint() throws IOException { // must get the latest solrCore object because the one we have might be closed because of a // reload // todo stop keeping solrCore around - SolrCore core = solrCore.getCoreContainer().getCore(solrCore.getName()); - try { + try (SolrCore core = solrCore.getCoreContainer().getCore(solrCore.getName())) { + if (core == null) { + return; // core closed, presumably + } Review Comment: Wondering if this would be an alternative: ``` if (core != null) { ... } ``` i.e. no `return;` statement and then the `replicationHandler.indexCommitPoint = commitPoint;` assignment could amount to `replicationHandler.indexCommitPoint = null;` which depending on the prior value is not the same as not assigning because of the `return`. Or if there's a `return` then could `IndexCommit commitPoint;` scope move into the `try` block? -- 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