Skip to content

fix: cap retry scheduler concurrency and jitter its backoff - #1153

Merged
alexluong merged 4 commits into
mainfrom
fix/retry-scheduler-load
Oct 21, 2026
Merged

alexluong merged 4 commits into
mainfrom
fix/retry-scheduler-load

Conversation

@alexluong

@alexluong alexluong commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Caps how many retries the retry scheduler runs at once and jitters its error backoff, so retries that come due together don't swamp the log store.

Monitor starts a goroutine per received task, with no limit. When thousands of retries come due within seconds, their lookups queue on the ClickHouse pool (10 connections, 10 s wait), most time out, back off exactly 30 s and come back together. The burst repeats at 30, 60, 120 and 240 s until the tasks are dead-lettered.

  1. RETRY_MAX_CONCURRENCY (default 100 per process, 0 = unbounded). The monitor takes a slot before it receives, so tasks over the limit wait in the queue without using up receives.
  2. Exec-error backoff is multiplied by a random factor in [0.75, 1.25), [0.75, 1) at the 15 min cap.
  3. RETRY_MAX_RECEIVE_COUNT (default 5), for log store outages longer than the backoff window (~7.5 min at the 30 s default).
  4. CLICKHOUSE_MAX_OPEN_CONNS (default: the client's 10), CLICKHOUSE_DIAL_TIMEOUT_SECONDS (default 10) and CLICKHOUSE_READ_TIMEOUT_SECONDS (default 30). clickhouse-go uses the dial timeout as the pool wait too.

Notes

  • Unbounded → 100 by default. A retry execution is one lookup and one publish, so the log store pool binds first.
  • Backoff is no longer exactly 30 s × 2^n.
  • ClickHouse defaults unchanged.

🤖 Generated with Claude Code

@alexluong
alexluong force-pushed the fix/scheduler-receipt-delete branch from 8b09f7d to cd7fce8 Compare October 19, 2026 19:52
@alexluong
alexluong force-pushed the fix/retry-scheduler-load branch 2 times, most recently from 0391e80 to f0fb24f Compare October 19, 2026 20:10
@alexluong
alexluong changed the base branch from fix/scheduler-receipt-delete to fix/retry-lookup-time-bound October 19, 2026 20:10
@alexluong
alexluong force-pushed the fix/retry-scheduler-load branch from f0fb24f to ae70404 Compare October 19, 2026 20:19

@alexbouchardd alexbouchardd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we try to process in batch instead? Not so much a comment on this work specifically but wondering if the one-by-one is really the right approach

@alexbouchardd

Copy link
Copy Markdown
Contributor

Ahh! #1155

@alexluong
alexluong force-pushed the fix/retry-lookup-time-bound branch from 8e822af to 7470a22 Compare October 21, 2026 15:32
Base automatically changed from fix/retry-lookup-time-bound to main October 21, 2026 15:32
@alexluong
alexluong force-pushed the fix/retry-scheduler-load branch from ae70404 to 119d936 Compare October 21, 2026 15:32
@alexluong
alexluong merged commit 8d11d6b into main Oct 21, 2026
1 check passed
@alexluong
alexluong deleted the fix/retry-scheduler-load branch October 21, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants