From d958b8e0fed77630882dccf208d78f0d44234a03 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 30 Jun 2020 11:45:34 -0400 Subject: [PATCH] do not mark node running until it is ready --- .../service/cloud/StandardNetworkService.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java index 2a588649..c791e5c3 100644 --- a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java +++ b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java @@ -349,15 +349,6 @@ public class StandardNetworkService implements NetworkService { } if (!setupOk) return die("newNode: error setting up, all retries failed for node: "+node.getUuid()); - // we are good. - final BubbleNetworkState finalState = nn.hasRestoreKey() ? BubbleNetworkState.restoring : BubbleNetworkState.running; - if (network.getState() != finalState) { - network.setState(finalState); - networkDAO.update(network); - } - node.setState(BubbleNodeState.running); - nodeDAO.update(node); - // wait for node to be ready final long readyStart = now(); boolean ready = false; @@ -379,6 +370,15 @@ public class StandardNetworkService implements NetworkService { if (!ready) { return die("newNode: timeout waiting for node ("+node.id()+") to be ready"); } + + // we are good. + final BubbleNetworkState finalState = nn.hasRestoreKey() ? BubbleNetworkState.restoring : BubbleNetworkState.running; + if (network.getState() != finalState) { + network.setState(finalState); + networkDAO.update(network); + } + node.setState(BubbleNodeState.running); + nodeDAO.update(node); progressMeter.completed(); } catch (Exception e) {