Skip to content

Commit

Permalink
Sleep 5 minutes on first parent host not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmv committed Oct 26, 2022
1 parent 0b77165 commit fcf295a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ private Optional<RunStatus> deployReal(RunId id, boolean setTheStage, DualLogger
controller.jobController().run(id)
.stepInfo(setTheStage ? deployInitialReal : deployReal).get()
.startTime().get(),
id,
logger)
.filter(result -> {
// If no tester cert, or deployment failed, propagate original result.
Expand All @@ -200,10 +201,11 @@ private Optional<RunStatus> deployTester(RunId id, DualLogger logger) {
controller.jobController().run(id)
.stepInfo(deployTester).get()
.startTime().get(),
id,
logger);
}

private Optional<RunStatus> deploy(Supplier<DeploymentResult> deployment, Instant startTime, DualLogger logger) {
private Optional<RunStatus> deploy(Supplier<DeploymentResult> deployment, Instant startTime, RunId id, DualLogger logger) {
try {
DeploymentResult result = deployment.get();
logger.logAll(result.log().stream()
Expand Down Expand Up @@ -246,6 +248,7 @@ private Optional<RunStatus> deploy(Supplier<DeploymentResult> deployment, Instan
}
case LOAD_BALANCER_NOT_READY, PARENT_HOST_NOT_READY -> {
logger.log(e.message()); // Consider splitting these messages in summary and details, on config server.
controller.jobController().locked(id, run -> run.sleepingUntil(startTime.plusSeconds(300)));
return result;
}
case NODE_ALLOCATION_FAILURE -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ public void realDeploymentRequiresForTesterCert() {
assertEquals(oldTrusted, tester.configServer().application(app.instanceId(), id.type().zone()).get().applicationPackage().trustedCertificates());

tester.configServer().throwOnNextPrepare(null);
tester.clock().advance(Duration.ofSeconds(300));
tester.runner().run();
assertEquals(succeeded, tester.jobs().run(id).stepStatuses().get(Step.deployTester));
assertEquals(succeeded, tester.jobs().run(id).stepStatuses().get(Step.deployReal));
Expand Down

0 comments on commit fcf295a

Please sign in to comment.