epugh commented on code in PR #2391:
URL: https://github.com/apache/solr/pull/2391#discussion_r2434251026


##########
solr/core/src/java/org/apache/solr/core/ZkContainer.java:
##########
@@ -326,14 +331,17 @@ public SolrMetricsContext getSolrMetricsContext() {
     }
   }
 
-  private static void startZKSE(int port, String zkHomeDir) throws Exception {
+  private void startZKSE(int port, String zkHomeDir) throws Exception {
     Properties p = new Properties();
-    p.load(new FileInputStream(zkHomeDir + "/zoo.cfg"));
+    try (FileInputStream fis = new FileInputStream(zkHomeDir + "/zoo.cfg")) {
+      p.load(fis);
+    }
     p.setProperty("clientPort", String.valueOf(port));
 
-    // TODO NOCOMMIT - hang onto the created ZooKeeperServerEmbedded to be 
able to close it
-    // gracefully the way we do today with zkServer
-    
ZooKeeperServerEmbedded.builder().baseDir(Path.of(zkHomeDir)).configuration(p).build().start();
+    zkServerEmbedded =

Review Comment:
   Ah ha!  The magic!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to