Hi LangGraph team,
We are occasionally seeing Redis connection timeouts from our LangGraph API / Agent Server Queue:
redis.exceptions.TimeoutError: Timeout connecting to server
Our LangGraph deployment and Redis are running on Kubernetes.
One possible scenario we are investigating is Redis pods being restarted/rescheduled during Kubernetes maintenance or patching. In that situation, Redis masters/endpoints may temporarily become unavailable or change while the LangGraph pods are still running.
We would therefore like to understand how Redis connection failures are handled internally by LangGraph Agent Server.
In particular:
- Is there already an automatic Redis reconnection/retry mechanism?
- If an existing Redis connection becomes invalid because a Redis pod/master moved or restarted, will LangGraph automatically establish a new connection?
- Does the Redis client/pool automatically recover from this situation?
- What happens after a
redis.exceptions.TimeoutError?- Is the failed connection discarded from the pool?
- Will the next operation attempt to establish a fresh connection?
- Or can the LangGraph pod remain in a state where subsequent Redis operations continue failing?
- Are there recommended Redis configuration parameters for this scenario?
For example, connection timeout, socket timeout, retry policy/backoff, health checks, or connection pool settings. - If automatic recovery is not currently handled, what is the recommended approach?
We were considering something along the lines of a bounded retry/reconnect strategy, for example:
Redis connection failure
↓
wait 30 seconds
↓
reconnect / retry
↓
maximum 3 attempts
↓
still failing → fail/crash the LangGraph pod
The idea would be to avoid infinite retries while still allowing the application to recover automatically from temporary Redis unavailability caused by Kubernetes pod rescheduling/failover. If Redis remains unreachable after the retry window, crashing the pod would allow Kubernetes to restart it cleanly.
Is this already handled by LangGraph / the underlying Redis library, or is there some configuration or application-level logic we should add?
Any guidance on the expected behavior and recommended production configuration for Redis running on Kubernetes would be appreciated.
Thanks!