apache/druid · warning
Exception pulling item from cache
Error message
Exception pulling item from cache
What it means
AbstractRedisCache.get() catches JedisException when fetching a value from Redis and logs a warning instead of propagating it, returning null so callers treat it as a cache miss. The message is emitted for any Redis read failure; if the message contains 'Read timed out' the timeoutCount metric is incremented, otherwise errorCount is. This is deliberately non-fatal: a broken cache should degrade lookup performance, not fail queries.
Solutions
- Check Redis connectivity from the Druid host (redis-cli ping) and fix host/port/password config under druid.cache type=redis
- Increase the timeout setting in the redis cache config so slow reads do not time out
- Check Redis server logs for restarts, maxmemory eviction, or failover events
- Monitor timeoutCount/errorCount metrics; treat persistent nonzero errorCount as a config/connectivity problem
- Ensure the query can tolerate cache misses (cache is always best-effort)
Example fix
// before: cache config with too-tight timeout
{"type":"redis","timeout":"50"}
// after
{"type":"redis","timeout":"2000"} Defensive patterns
Strategy: fallback
Validate before calling
// pre-check Redis reachability before relying on cached values
try (Jedis j = new Jedis(host, port, 2000)) { j.ping(); } Try / catch
// get() already swallows failures; treat null as miss
byte[] val = cache.get(key);
if (val == null) { /* recompute from deep storage */ } Prevention
- Right-size the Redis timeout config
- Monitor timeoutCount/errorCount metrics
- Deploy Redis in the same datacenter/network as Druid
- Alert on Redis restarts and maxmemory evictions
When it happens
Trigger: Calling cache.get(key) when the Redis server is unreachable, connection is reset, or the socket read exceeds the configured timeout.
Common situations: Redis host/port misconfigured; Redis restarted or crashed; network latency or firewall dropping connections; Redis undersized so reads exceed the configured timeout; cluster failover in progress.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- Exception pulling items from cache
- Exception pulling item from cache
- Query [ ] timed out!
- Timed out after [ ] millis during flushing
- Cache for node role [ ] could not be initialized before…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/7cacfcda70f7e9ae.
Report an issue: GitHub.
Appendix: source
Thrown at extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/AbstractRedisCache.java:73
{
totalRequestCount.incrementAndGet();
try {
byte[] bytes = getFromRedis(key.toByteArray());
if (bytes == null) {
missCount.incrementAndGet();
return null;
} else {
hitCount.incrementAndGet();
return bytes;
}
}
catch (JedisException e) {
if (e.getMessage().contains("Read timed out")) {
timeoutCount.incrementAndGet();
} else {
errorCount.incrementAndGet();
}
log.warn(e, "Exception pulling item from cache");
return null;
}
}
@Override
public void put(NamedKey key, byte[] value)
{
totalRequestCount.incrementAndGet();
try {
this.putToRedis(key.toByteArray(), value, this.expiration);
}
catch (JedisException e) {
errorCount.incrementAndGet();
log.warn(e, "Exception pushing item to cache");
}
}
@OverrideView on GitHub (pinned to 9b90983fd2)