DomGarguilo commented on code in PR #5697: URL: https://github.com/apache/accumulo/pull/5697#discussion_r2177940388
########## minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java: ########## @@ -1094,6 +1098,35 @@ protected ExecutorService getShutdownExecutor() { return executor; } + public void stopProcessesWithTimeout(final ServerType type, final List<Process> procs, + final long timeout, final TimeUnit unit) { + + final List<Future<Integer>> futures = new ArrayList<>(); + for (Process proc : procs) { + futures.add(executor.submit(() -> { + proc.destroy(); + proc.waitFor(timeout, unit); + return proc.exitValue(); + })); + } + + while (!futures.isEmpty()) { + Iterator<Future<Integer>> iter = futures.iterator(); + while (iter.hasNext()) { + Future<Integer> f = iter.next(); Review Comment: it might simplify things to do `futures.removeIf()` here although it doesn't make a functional difference. -- 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: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org