Problem
BrokerActor re-implements reconnect backoff by hand and without jitter: const delay = Math.min(initial * Math.pow(factor, this._reconnectAttempt - 1), maxDelay) (src/io/broker/BrokerActor.ts:566-586). DEFAULT_RECONNECT (src/io/broker/BrokerOptions.ts:63-68) has no jitter field.
Every broker actor on every node therefore retries in lockstep after a broker restart — textbook thundering herd. The framework already owns the fix 40 lines away: exponentialBackoff in src/pattern/BackoffPolicy.ts:56-77 has randomFactor (default 0.2) and an injectable random for deterministic tests.
Proposed behaviour
Delete the hand-rolled arithmetic; call exponentialBackoff({ minMs, maxMs, randomFactor }). Add reconnect.randomFactor to BrokerCommonOptionsType, readCommonOptions, BrokerOptionsValidator.commonRules and BrokerOptionsBuilder.withReconnect.
Acceptance criteria
- Two actors started together do not retry at the same millisecond.
- The
random seam keeps the existing reconnect tests deterministic.
Related: #457, #458
Problem
BrokerActorre-implements reconnect backoff by hand and without jitter:const delay = Math.min(initial * Math.pow(factor, this._reconnectAttempt - 1), maxDelay)(src/io/broker/BrokerActor.ts:566-586).DEFAULT_RECONNECT(src/io/broker/BrokerOptions.ts:63-68) has no jitter field.Every broker actor on every node therefore retries in lockstep after a broker restart — textbook thundering herd. The framework already owns the fix 40 lines away:
exponentialBackoffinsrc/pattern/BackoffPolicy.ts:56-77hasrandomFactor(default 0.2) and an injectablerandomfor deterministic tests.Proposed behaviour
Delete the hand-rolled arithmetic; call
exponentialBackoff({ minMs, maxMs, randomFactor }). Addreconnect.randomFactortoBrokerCommonOptionsType,readCommonOptions,BrokerOptionsValidator.commonRulesandBrokerOptionsBuilder.withReconnect.Acceptance criteria
randomseam keeps the existing reconnect tests deterministic.Related: #457, #458