Background
C++ agent gRPC reconnect behavior currently relies on fixed channel readiness waits. When collectors are down or restarting, many agents can retry on similar intervals and create a thundering herd risk.
The Java agent mitigates this with ExponentialBackoffReconnectJob using:
- initialInterval: 3000ms
- multiplier: 1.2
- randomizationFactor: 0.3
- maxInterval: 30000ms
Scope
- Add a reusable exponential backoff helper with jitter.
- Apply jittered backoff only in the shared gRPC channel readiness path.
- Use WaitForStateChange during the backoff window instead of sleeping, with 1s slices.
- Call readyChannel() before metadata unary RPCs.
- Reset backoff after the channel becomes ready.
- Add unit tests for delay growth, cap, reset, jitter bounds, and metadata channel-not-ready behavior.
Validation
- cmake --build --preset debug-cached
- ctest --preset debug-cached
Background
C++ agent gRPC reconnect behavior currently relies on fixed channel readiness waits. When collectors are down or restarting, many agents can retry on similar intervals and create a thundering herd risk.
The Java agent mitigates this with ExponentialBackoffReconnectJob using:
Scope
Validation