Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/49#discussion_r137865504 --- Diff: tephra-core/src/main/java/org/apache/tephra/distributed/TransactionService.java --- @@ -121,15 +121,15 @@ public void failed(State from, Throwable failure) { @Override public void follower() { ListenableFuture stopFuture = null; + if (pruningService != null && pruningService.isRunning()) { + // Wait for pruning service to stop after un-registering from discovery + stopFuture = pruningService.stop(); + } // First stop the transaction server as un-registering from discovery can block sometimes. // That can lead to multiple transaction servers being active at the same time. if (server != null && server.isRunning()) { server.stopAndWait(); } - if (pruningService != null && pruningService.isRunning()) { - // Wait for pruning service to stop after un-registering from discovery - stopFuture = pruningService.stop(); - } undoRegister(); if (stopFuture != null) { --- End diff -- It would be good to add a timeout to the `Futures.getUnchecked(stopFuture)` in the next line, so that we don't block forever. ---