Repository navigation
refactor(retry): add full-jitter mode and adopt it for mattermost client retries - #104594
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 1:44 PM ET / 17:44 UTC. Summary PR surface: Source +27, Tests +162. Total +189 across 4 files. Reproducibility: yes. at source level: the current Mattermost loop, schedule-pinning tests, callback contract, and shared retry helper provide a high-confidence equivalence path. No real Mattermost service failure-and-recovery run is attached. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Use the canonical shared retry engine for Mattermost, keep full-jitter semantics explicitly tested, and expose only the smallest maintainer-approved plugin SDK contract—preferably retaining deterministic randomness as an internal test seam unless external consumers need it. Do we have a high-confidence way to reproduce the issue? Yes at source level: the current Mattermost loop, schedule-pinning tests, callback contract, and shared retry helper provide a high-confidence equivalence path. No real Mattermost service failure-and-recovery run is attached. Is this the best way to solve the issue? Mostly yes: consolidating the loop into AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 49ff54e63af5. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +27, Tests +162. Total +189 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
Related: #104318
What Problem This Solves
Mattermost was the last Phase-1 retry holdout: its full-jitter schedule (uniform [delay, 2·delay) with cap-after-draw and a minimum floor, pinned by tests) was inexpressible in core
retryAsync, so #104431 had to skip it and it kept a hand-rolled loop.Why This Change Was Made
Core
RetryConfig.jitterwidens fromnumbertonumber | "full"— no parallel field, no new config surface (config schemas stay number-only; the mode is code-declared). An injectable random source follows the existing streaming/tagline pattern for deterministic tests. Mattermost's client loop then migrates ontoretryAsyncvia the standard SDK seam with its classification unchanged; its schedule-pinning test passes byte-identical. Two review-driven hardenings shipped with it: the documented cap now beats the floor wheninitialDelayMs > maxDelayMs(valid config the schema refine doesn't catch), and over-cap Retry-After draws spread downward in [cap/2, cap) so full-jitter retries don't collapse into an anti-herd-defeating lockstep at the cap — that spread is a deliberate design choice worth a reviewer glance.User Impact
No behavior change for existing callers (
jitter: numbersemantics untouched); mattermost retry cadence unchanged by test proof.Evidence
tbx_01kx922d7amd3fqj33whea7b0g:extensions/mattermost/src+src/infrasuites (262+44 files) + fullpnpm check:changedgreen;client.retry.test.tsunmodified and passing (the acceptance bar).