{"record":{"id":"5da1d3fa95729610","repo":"eclipse-vertx/vert.x","slug":"timed-out-waiting-for-redeploy-on-failover","errorCode":null,"errorMessage":"Timed out waiting for redeploy on failover","messagePattern":"Timed out waiting for redeploy on failover","errorType":"exception","errorClass":"VertxException","httpStatus":null,"severity":"critical","filePath":"vertx-core/src/main/java/io/vertx/core/impl/HAManager.java","lineNumber":538,"sourceCode":"    ((VertxImpl)vertx).executeIsolated(v -> {\n      JsonObject options = failedVerticle.getJsonObject(\"options\");\n      doDeployVerticle(verticleName, new DeploymentOptions(options)).onComplete(result -> {\n        if (result.succeeded()) {\n          log.info(\"Successfully redeployed verticle \" + verticleName + \" after failover\");\n        } else {\n          log.error(\"Failed to redeploy verticle after failover\", result.cause());\n          err.set(result.cause());\n        }\n        latch.countDown();\n        Throwable t = err.get();\n        if (t != null) {\n          throw new VertxException(t);\n        }\n      });\n    });\n    try {\n      if (!latch.await(120, TimeUnit.SECONDS)) {\n        throw new VertxException(\"Timed out waiting for redeploy on failover\");\n      }\n    } catch (InterruptedException e) {\n      throw new IllegalStateException(e);\n    }\n  }\n\n  // Compute the failover node\n  private String chooseHashedNode(String group, int hashCode) {\n    List<String> nodes = clusterManager.getNodes();\n    ArrayList<String> matchingMembers = new ArrayList<>();\n    for (String node: nodes) {\n      String sclusterInfo = clusterMap.get(node);\n      if (sclusterInfo != null) {\n        JsonObject clusterInfo = new JsonObject(sclusterInfo);\n        String memberGroup = clusterInfo.getString(\"group\");\n        if (group == null || group.equals(memberGroup)) {\n          matchingMembers.add(node);\n        }","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/impl/HAManager.java#L520-L556","documentation":"processFailover blocks on a CountDownLatch until the failed verticle is redeployed on this node, with a 120-second timeout. If the redeploy future does not complete in time, VertxException('Timed out waiting for redeploy on failover') is thrown.","triggerScenarios":"HA failover where clusterManager.deployVerticle (redeploy) never completes within 120s — cluster is degraded, quorum lost, or the deployment future failed to resolve while latch.await(120s) expired.","commonSituations":"Slow or partitioned cluster managers (ZooKeeper/Hazelcast/InfiniGrid) during failover; the redeployed verticle's start future never completing due to missing resources or blocked event loop; oversized deployment with slow initialization.","solutions":["Inspect why the redeploy never finished: check cluster manager logs/health and quorum settings","Fix the verticle's start() so it completes its startPromise promptly; remove blocking calls","Verify cluster connectivity and increase stability of the network between HA nodes","Ensure the haGroup/quorum configuration matches across nodes"],"exampleFix":"// before\npublic void start(Promise<Void> p) {\n  connectBlocking(); // blocks event loop, redeploy future stalls\n  p.complete();\n}\n// after\npublic void start(Promise<Void> p) {\n  client.connect().onSuccess(ok -> p.complete()).onFailure(p::fail);\n}","handlingStrategy":"retry","validationCode":"// pre-check cluster health before enabling HA failover\nif (!clusterManager.isActive()) log.warn(\"Cluster manager inactive; failover may time out\");","typeGuard":null,"tryCatchPattern":"try { deployWithHa(); } catch (VertxException e) { if (e.getMessage().contains(\"Timed out waiting for redeploy\")) { alertOps(); scheduleRetry(); } }","preventionTips":["Keep verticle start() non-blocking; complete startPromise promptly","Monitor cluster manager health/quorum between HA nodes","Size deployments so redeploy finishes well under 120s","Check network partitions and GC pauses on HA nodes"],"tags":["ha","failover","timeout","deployment","cluster"],"backgroundTag":"request-timeout","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}