fix: widen CSMA post-reset jitter to prevent thundering herd - #2304
Conversation
When multiple runners exhaust the GraphQL rate limit simultaneously, they all sleep until the same reset timestamp and wake up together. The existing slot jitter (250-750ms) is too narrow to desynchronize them, causing collisions that surface as "unknown owner type" errors from gh project view. Add a post-reset spread of up to 60s (configurable via GITHUB_CSMA_SPREAD_MAX_SEC) so runners fan out over a wide window after waking from a rate-limit sleep. Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
Site previewPreview: https://44db34ab-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 8:37 PM UTC · Completed 8:47 PM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Low
|
rh-hemartin
left a comment
There was a problem hiding this comment.
The title of this PR sounds like magic 🤣
|
Lol :D |
|
🤖 Finished Retro · ✅ Success · Started 4:56 PM UTC · Completed 5:03 PM UTC |
Retro: PR #2304 — fix: widen CSMA post-reset jitter to prevent thundering herdTimeline: Human-authored PR by Review quality: Good. The review agent correctly identified a legitimate incomplete-fix gap. The two low findings (off-by-one range, naming consistency) were reasonable but not high-signal. Unresolved finding merged: The medium finding about the missing spread in the retry path was not addressed before merge. This is a known pattern already tracked by multiple open issues (#1956, #870, #1941, #1201), so no new proposal is filed for that workflow gap. One proposal filed: A concrete bug for the missing post-reset spread in Proposals filed
|
…ter_rate_limit PR fullsend-ai#2304 added post-reset spread to github_csma_sense to prevent thundering herd when runners wake after a rate-limit reset. The structurally parallel _github_csma_sleep_after_rate_limit function was missing the same treatment — multiple runners hitting a 429 would all wake at the same reset timestamp and fire simultaneously. Extract the spread logic into a shared _github_csma_post_reset_spread helper and call it from both github_csma_sense (replacing the inline code) and _github_csma_sleep_after_rate_limit (added after the backoff sleep). Both paths now use GITHUB_CSMA_SPREAD_MAX_SEC to stagger runner wake times. Note: pre-commit and make lint could not run due to shellcheck-py network restriction in sandbox. Scaffold Go tests pass. Closes fullsend-ai#2343
Summary
unknown owner typeerrors fromgh project view— its internal owner-resolution GraphQL call got trampled by sibling runnersGITHUB_CSMA_SPREAD_MAX_SEC) so runners fan out over a wide window after wakingContext
Observed in https://github.com/fullsend-ai/.fullsend/actions/runs/27572357937/job/81511878257 — the prioritize agent succeeded but
post-prioritize.shfailed because the CSMA sense function woke all runners simultaneously after a graphql rate limit reset.Test plan
post-prioritize-test.shpasses