Skip to content

Commit

Permalink
Deal with quick service start failures
Browse files Browse the repository at this point in the history
It is possible for the service furture to fail exceptionally before we
first poll for waiting, so we should switch to a do/while loop so we
will get the exception re-thrown instead of ignoring it.

This may fix hyperledger#662

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
  • Loading branch information
shemnon committed Apr 15, 2020
1 parent d6fabbd commit 6711380
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions besu/src/main/java/org/hyperledger/besu/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void waitForServiceToStop(final String serviceName, final SynchronousShu

private void waitForServiceToStart(
final String serviceName, final CompletableFuture<?> startFuture) {
while (!startFuture.isDone()) {
do {
try {
startFuture.get(60, TimeUnit.SECONDS);
} catch (final InterruptedException e) {
Expand All @@ -196,7 +196,7 @@ private void waitForServiceToStart(
} catch (final TimeoutException e) {
LOG.warn("Service {} is taking an unusually long time to start", serviceName);
}
}
} while (!startFuture.isDone());
}

private void writeBesuPortsToFile() {
Expand Down

0 comments on commit 6711380

Please sign in to comment.