{"record":{"id":"9e9c1dc8c981e982","repo":"apache/druid","slug":"sockettimeout-s-must-be-greater-than-watchsecon","errorCode":null,"errorMessage":"socketTimeout [%s] must be greater than watchSeconds [%s]","messagePattern":"socketTimeout \\[(.+?)\\] must be greater than watchSeconds \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java","lineNumber":122,"sourceCode":"      ServiceConfig service,\n      LeaderElectionConfig leader,\n      WatchConfig watch\n  )\n  {\n    this.connection = connection == null ? new ConnectionConfig(null, null, null, null, null, null, null) : connection;\n    this.auth = auth == null ? new AuthConfig(null, null, null, null) : auth;\n    this.service = service;\n    this.leader = leader;\n    this.watch = watch == null ? new WatchConfig(null, null, null, null) : watch;\n\n    validateCrossFieldConstraints();\n  }\n\n  private void validateCrossFieldConstraints()\n  {\n    // Socket timeout must exceed watch timeout to avoid premature disconnects\n    if (connection.getSocketTimeout().compareTo(watch.getWatchSeconds()) <= 0) {\n      throw new IAE(\n          StringUtils.format(\n              \"socketTimeout [%s] must be greater than watchSeconds [%s]\",\n              connection.getSocketTimeout(),\n              watch.getWatchSeconds()\n          )\n      );\n    }\n\n    long serviceTtlSeconds = Math.max(30, service.getHealthCheckInterval().getStandardSeconds() * 3);\n    if (service.getDeregisterAfter().getStandardSeconds() < serviceTtlSeconds) {\n      throw new IAE(\n          StringUtils.format(\n              \"deregisterAfter (%ds) must be >= service TTL (%ds = 3 × healthCheckInterval)\",\n              service.getDeregisterAfter().getStandardSeconds(),\n              serviceTtlSeconds\n          )\n      );\n    }","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java#L104-L140","documentation":"Cross-field config validation: a blocking Consul watch waits up to watchSeconds; if connection.socketTimeout <= watchSeconds the HTTP read times out before the server responds, so the combination is rejected when the config is constructed.","triggerScenarios":"Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise connection.socketTimeout above watch.watchSeconds (e.g. watchSeconds plus a margin).","Or lower watchSeconds to fit under the configured socket timeout."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}