Repository navigation
fix(amm): retry Horizon rate limits - #398
Conversation
|
@abdulrahmanj383-creator Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Miracle656 The three failing AMM ingestion tests now mock successful Horizon responses ( |
|
Merged as Three things in the implementation are better than they had to be:
Full jitter, not fixed backoff. const exponential = Math.min(1_000 * 2 ** attempt, 30_000)
return Math.round(exponential * (0.75 + Math.random() * 0.5))Four ingesters poll on the same interval. With a fixed backoff they get rate-limited together, sleep together, and retry together — rate-limiting each other again. Jitter is what breaks that, and it is the part people leave out. A persistent 429 is raised, not logged. Merged locally; two conflicts, both against work landed since you cut the branch. The fix on top: the helper used a bare
|
Validates Horizon responses before JSON parsing, records the remaining-quota gauge, and retries 429 responses using Retry-After or bounded exponential backoff with jitter. Persistent 429 responses propagate as errors so they cannot be mistaken for an empty pool list.
Closes #348