in geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/ProcessControl.java [55:74]
public static void retryUntilZeroExit(final ProcessBuilder processBuilder)
throws IOException, InterruptedException {
long start = System.nanoTime();
while (true) {
final Process process = processBuilder.start();
final int exitStatus = process.waitFor();
if (exitStatus != 0) {
final String msg =
format("'%s' command exited with status %d", join(" ", processBuilder.command()),
exitStatus, System.getProperty("user.dir"));
logger.error(msg);
if (System.nanoTime() - start > RETRY_TIMEOUT.toNanos()) {
throw new RuntimeException(msg);
}
Thread.sleep(100);
continue;
}
break;
}
}