{"record":{"id":"f3baefaaafd1fe54","repo":"eclipse-vertx/vert.x","slug":"querytimeout-must-be-0","errorCode":null,"errorMessage":"queryTimeout must be > 0","messagePattern":"queryTimeout must be > 0","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/dns/AddressResolverOptions.java","lineNumber":397,"sourceCode":"    return this;\n  }\n\n  /**\n   * @return the query timeout in milliseconds\n   */\n  public long getQueryTimeout() {\n    return queryTimeout;\n  }\n\n  /**\n   * Set the query timeout in milliseconds, i.e the amount of time after a query is considered to be failed.\n   *\n   * @param queryTimeout the query timeout in milliseconds\n   * @return a reference to this, so the API can be used fluently\n   */\n  public AddressResolverOptions setQueryTimeout(long queryTimeout) {\n    if (queryTimeout < 1) {\n      throw new IllegalArgumentException(\"queryTimeout must be > 0\");\n    }\n    this.queryTimeout = queryTimeout;\n    return this;\n  }\n\n  /**\n   * @return the maximum number of queries to be sent during a resolution\n   */\n  public int getMaxQueries() {\n    return maxQueries;\n  }\n\n  /**\n   * Set the maximum number of queries when an hostname is resolved.\n   *\n   * @param maxQueries the max number of queries to be sent\n   * @return a reference to this, so the API can be used fluently\n   */","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/dns/AddressResolverOptions.java#L379-L415","documentation":"Configuration validation in setQueryTimeout: a DNS query timeout of zero or negative milliseconds is invalid because the resolver would consider every query failed instantly. The setter enforces a minimum of 1 ms before accepting the value.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/dns/AddressResolverOptions.java:397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a positive timeout in milliseconds (e.g. 5000 for 5 seconds)","Set the timeout from a validated configuration source rather than raw user input"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}