Github user anew commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/49#discussion_r137879378
  
    --- 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<State> 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 --
    
    pruningService.shutdown() itself has a 30 second timeout. So this future is 
guaranteed to return, and we don't need a timeout here. 


---

Reply via email to