apache/druid · warning
Ohh no! UnusedConnectionTimeout
Error message
Ohh no! UnusedConnectionTimeout[%s] is longer than readTimeout[%s], please correct the configuration, this might not be supported in future.
What it means
Log warning in DruidHttpClientConfig.getUnusedConnectionTimeout. If unusedConnectionTimeout is greater than or equal to readTimeout, the pool's idle-connection eviction is ineffective because a connection would be closed by the read timeout before it can be evicted for idleness; the config warns that this combination may be unsupported in future versions.
Solutions
- Set druid.http.unusedConnectionTimeout strictly less than druid.http.readTimeout (e.g. unusedConnectionTimeout=PT4M with readTimeout=PT5M).
- Or unset unusedConnectionTimeout (null) so only readTimeout applies.
- Double-check the durations are not accidentally swapped in runtime.properties.
- Plan for the future version where this combination may be rejected outright.
Example fix
// before druid.http.readTimeout=PT5M druid.http.unusedConnectionTimeout=PT10M // after druid.http.readTimeout=PT5M druid.http.unusedConnectionTimeout=PT4M
Defensive patterns
Strategy: validation
Validate before calling
// Validate http timeout ordering before building the client
Duration unused = config.getUnusedConnectionTimeoutConfig();
Duration read = config.getReadTimeoutConfig();
if (unused != null && read != null && unused.compareTo(read) >= 0) {
throw new ConfigException("unusedConnectionTimeout must be < readTimeout");
} Prevention
- Keep unusedConnectionTimeout strictly below readTimeout
- Validate duration ordering in config linters
- Unset unusedConnectionTimeout if readTimeout alone suffices
- Check for swapped values when copying configs between environments
When it happens
Trigger: getUnusedConnectionTimeout() is called (during HttpClient builder construction) with both druid.http.unusedConnectionTimeout and druid.http.readTimeout set and unusedConnectionTimeout >= readTimeout, e.g. unusedConnectionTimeout=PT10M with readTimeout=PT5M.
Common situations: Operators setting a long unusedConnectionTimeout to keep pooled connections alive while a readTimeout was added for query latency; copied http client tuning between node types; typo swapping the two duration values.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Cleaning up idle connections is a bad idea. If your…
- Failed to apply webClientOptions to WebClientOptions. Check…
- No sslContext set, cannot do https
- A valid tlsPort needs to specified when druid.enableTlsPort…
- At least one of the druid.enablePlaintextPort or…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/0c2e5d83f2e8c843.
Report an issue: GitHub.
Appendix: source
Thrown at server/src/main/java/org/apache/druid/guice/http/DruidHttpClientConfig.java:113
{
return compressionCodec;
}
public int getNumRequestsQueued()
{
return numRequestsQueued;
}
public int getRequestBuffersize()
{
return requestBuffersize;
}
public Duration getUnusedConnectionTimeout()
{
if (unusedConnectionTimeout != null && readTimeout != null
&& unusedConnectionTimeout.toStandardDuration().compareTo(readTimeout.toStandardDuration()) >= 0) {
LOG.warn(
"Ohh no! UnusedConnectionTimeout[%s] is longer than readTimeout[%s], please correct"
+ " the configuration, this might not be supported in future.",
unusedConnectionTimeout,
readTimeout
);
}
return unusedConnectionTimeout == null ? null : unusedConnectionTimeout.toStandardDuration();
}
public long getMaxQueuedBytes()
{
return maxQueuedBytes.getBytes();
}
public boolean isEagerInitialization(boolean defaultValue)
{
if (null == eagerInitialization) {
return defaultValue;View on GitHub (pinned to 9b90983fd2)