tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poornachandra <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #49: [TEPHRA-242] Ensure Pruning Service shuts...
Date Fri, 08 Sep 2017 18:56:14 GMT
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<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 --
    
    It would be good to add a timeout to the `Futures.getUnchecked(stopFuture)` in the next
line, so that we don't block forever.


---

Mime
View raw message