{"record":{"id":"892890a3511cb6d7","repo":"eclipse-vertx/vert.x","slug":"maxexecutetime-must-be-0","errorCode":null,"errorMessage":"maxExecuteTime must be > 0","messagePattern":"maxExecuteTime must be > 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"info","filePath":"vertx-core/src/main/java/io/vertx/core/DeploymentOptions.java","lineNumber":242,"sourceCode":"   * @return The value of max worker execute time, the default value of {@link DeploymentOptions#setMaxWorkerExecuteTimeUnit} {@code maxWorkerExecuteTimeUnit} is {@link TimeUnit#NANOSECONDS}\n   */\n  public long getMaxWorkerExecuteTime() {\n    return maxWorkerExecuteTime;\n  }\n\n  /**\n   * Sets the value of max worker execute time, in {@link DeploymentOptions#setMaxWorkerExecuteTimeUnit maxWorkerExecuteTimeUnit}.\n   * <p>\n   * The default value of {@link DeploymentOptions#setMaxWorkerExecuteTimeUnit maxWorkerExecuteTimeUnit} is {@link TimeUnit#NANOSECONDS}\n   * <p>\n   * When the verticle does not use a {@link #getWorkerPoolName() named worker pool}, this option has no effect.\n   *\n   * @param maxWorkerExecuteTime the value of max worker execute time, in in {@link DeploymentOptions#setMaxWorkerExecuteTimeUnit maxWorkerExecuteTimeUnit}.\n   * @return a reference to this, so the API can be used fluently\n   */\n  public DeploymentOptions setMaxWorkerExecuteTime(long maxWorkerExecuteTime) {\n    if (maxWorkerExecuteTime < 1) {\n      throw new IllegalArgumentException(\"maxExecuteTime must be > 0\");\n    }\n    this.maxWorkerExecuteTime = maxWorkerExecuteTime;\n    return this;\n  }\n\n  /**\n   * When the verticle does not use a {@link #getWorkerPoolName() named worker pool}, this option has no effect.\n   *\n   * @return the time unit of {@code maxWorkerExecuteTime}\n   */\n  public TimeUnit getMaxWorkerExecuteTimeUnit() {\n    return maxWorkerExecuteTimeUnit;\n  }\n\n  /**\n   * Set the time unit of {@code maxWorkerExecuteTime}\n   * <p>\n   * When the verticle does not use a {@link #getWorkerPoolName() named worker pool}, this option has no effect.","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/DeploymentOptions.java#L224-L260","documentation":"SC_BAD_GATEWAY is an HttpResponseExpectation constant asserting an HTTP response status of 502. The companion int constant SC_BAD_GATEWAY = 502 also exists in HttpUtils for internal use. The expectation fails when the validated response status is not 502, surfacing the '502 Bad Gateway' message.","triggerScenarios":"Passing HttpResponseExpectation.SC_BAD_GATEWAY to a client expectation (request.expect(...)) against a response whose status is not exactly 502; internal Vert.x code comparing response codes against HttpUtils.SC_BAD_GATEWAY.","commonSituations":"A gateway/proxy behind the Vert.x client returned 502 because the upstream is down, while the test/code expected a different status; integration tests asserting proxy failure semantics.","solutions":["If 502 was not intended, fix the upstream/gateway availability or routing so the real expected status is returned.","Update the expectation to the status the server actually returns, or accept a range via HttpResponseExpectation.status(...)/custom predicate.","When deliberately testing gateway failures, keep SC_BAD_GATEWAY but ensure the reverse proxy is configured to produce 502 for the scenario."],"exampleFix":"// before\nrequest.expect(HttpResponseExpectation.SC_BAD_GATEWAY).send();\n// after\nrequest.expect(HttpResponseExpectation.status(200)).send();","handlingStrategy":"retry","validationCode":"// treat 502 as transient upstream failure before validating\nif (response.statusCode() == 502 && !retryAllowed) throw new IllegalStateException(\"Upstream gateway unavailable\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor upstream health so 502s are detected before tests depend on them.","Only assert SC_BAD_GATEWAY in tests that deliberately simulate gateway failure.","Add retry with backoff for idempotent requests that may transit proxies."],"tags":["http","status-code","gateway","expectation"],"backgroundTag":"http-error-status","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}