Repository: incubator-tephra Updated Branches: refs/heads/master 8f958edb6 -> 39f4fde63
Ensure Pruning Service shuts down This closes #49 Signed-off-by: anew <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-tephra/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tephra/commit/39f4fde6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tephra/tree/39f4fde6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tephra/diff/39f4fde6 Branch: refs/heads/master Commit: 39f4fde635a70b4e9b6ecaf3d2879e57c8ebb641 Parents: 8f958ed Author: anew <[email protected]> Authored: Thu Aug 31 15:41:10 2017 -0700 Committer: anew <[email protected]> Committed: Fri Sep 8 14:12:54 2017 -0700 ---------------------------------------------------------------------- .../org/apache/tephra/distributed/TransactionService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tephra/blob/39f4fde6/tephra-core/src/main/java/org/apache/tephra/distributed/TransactionService.java ---------------------------------------------------------------------- diff --git a/tephra-core/src/main/java/org/apache/tephra/distributed/TransactionService.java b/tephra-core/src/main/java/org/apache/tephra/distributed/TransactionService.java index d4a0f87..f95e5b3 100644 --- a/tephra-core/src/main/java/org/apache/tephra/distributed/TransactionService.java +++ b/tephra-core/src/main/java/org/apache/tephra/distributed/TransactionService.java @@ -121,15 +121,15 @@ public final class TransactionService extends InMemoryTransactionService { @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) {
