Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

fix: survive Redis restarts with infinite reconnection policy#89

Merged
christopherwxyz merged 1 commit into
mainfrom
fix/redis-reconnection-recovery
Feb 9, 2026
Merged

fix: survive Redis restarts with infinite reconnection policy#89
christopherwxyz merged 1 commit into
mainfrom
fix/redis-reconnection-recovery

Conversation

@christopherwxyz

Copy link
Copy Markdown
Contributor

Summary

After a Redis restart, waypoint pods entered an infinite timeout loop and never recovered — requiring manual pod restarts.

Root cause: ReconnectPolicy::new_exponential(3, ...) — Fred gave up reconnecting after 3 failed attempts, leaving the pool permanently dead.

Fix:

  • Set max_attempts=0 (infinite retries with exponential backoff up to 30s) per Fred docs
  • Add 50ms jitter to reconnect delays to prevent thundering herd
  • Wire up Fred EventInterface (on_error, on_reconnect, on_unresponsive) for connection event visibility
  • Health monitor now calls force_reconnection() when pool state is Disconnected instead of just logging

Test plan

  • Deploy to staging, verify waypoint connects to Redis normally
  • Kill the Redis pod (kubectl delete pod) while waypoint is running
  • Verify waypoint logs show reconnection events and recovers automatically within ~30s
  • Verify no data loss — producer resumes from checkpoint, consumers resume from last ACK'd position

The reconnect policy was configured with max_attempts=3, meaning Fred
would give up reconnecting after 3 failed attempts. After a Redis
restart, the pool would permanently die and all operations would
timeout forever — requiring pod restarts to recover.

Changes:
- Set ReconnectPolicy max_attempts=0 (infinite retries with exp backoff)
- Add 50ms jitter to reconnect delays to prevent thundering herd
- Wire up Fred EventInterface (on_error, on_reconnect, on_unresponsive)
  for connection visibility
- Health monitor now calls force_reconnection() when pool is
  disconnected instead of just logging a warning
@christopherwxyz
christopherwxyz force-pushed the fix/redis-reconnection-recovery branch from bb8a4ce to fa1f855 Compare February 9, 2026 19:57
@christopherwxyz
christopherwxyz merged commit d06d921 into main Feb 9, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant