Files
Qian Chen 29e6a1f7b0 Add client-side max lifetime for replication streams (#11356)
## What changed?
Introduce history.ReplicationStreamMaxLifetime (with a companion jitter
coefficient) so the stream receiver gracefully recycles each replication
stream after a bounded, jittered interval. When the lifetime elapses the
receiver stops the stream and the stream receiver monitor reopens a
fresh one, which can land on a different (non-draining) connection.


## Why?
This lets proxies such as Envoy gracefully drain connections that would
otherwise be pinned open indefinitely by endless replication streams,
and bounds the number of outbound connections a history pod accumulates.

Disabled by default (0). Receiver-side only; mirrors the existing
livenessMonitor. Jitter is clamped to [0,1] to guard against a
misconfigured dynamic value panicking backoff.Jitter.

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-11 09:52:06 -07:00
..