Add global Cloudflare throttle for player_crawl; cap player_crawl workers at 50#37
Conversation
…hroughput Co-authored-by: owens1127 <98496129+owens1127@users.noreply.github.com>
|
@copilot can you ensure this only activates above X events in N seconds? Also don't decrease Zeus anymore--undo that. Plus, cap player crawl workers at 50 if not already |
…t 50 Co-authored-by: owens1127 <98496129+owens1127@users.noreply.github.com>
Done in a2a5184:
|
| time.AfterFunc(cloudflareThrottleDuration, func() { | ||
| cloudflareThrottleMu.Lock() | ||
| defer cloudflareThrottleMu.Unlock() | ||
| if cloudflareIsThrottled && cloudflareGeneration == gen { |
There was a problem hiding this comment.
But don't we increase the gen on every call? If 3 errors come in at the same time, wouldn't they all have different gens? We don't early return if throttling is enabled.
There was a problem hiding this comment.
Fixed in 3bfd3a8. Added an early return when cloudflareIsThrottled is already true, so gen is only incremented and a timer is only spawned once per throttle activation — not on every subsequent error above the threshold. With the bug, 50 concurrent errors above the threshold would spawn 48 timers and increment gen 48 times; now only the first one to see !cloudflareIsThrottled does any work.
Co-authored-by: owens1127 <98496129+owens1127@users.noreply.github.com>
|
Superseded by #76, which handles Cloudflare blocks with a single quick in-process retry and unlimited Hermes queue backoff (no message drops) instead of global throttling. |
lib/web/bungie/cloudflare_throttle.gowith global Cloudflare throttle mechanismgenis only incremented and a single timer is only spawned once per throttle activation (not per-error)lib/messaging/queue-workers/player_crawl.goto wait for and signal the Cloudflare throttleMaxWorkersat 50Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.