[256] Optimize poller throttling parameters in indexer_runner - #375
Merged
2 commits merged intoAug 30, 2026
Conversation
added 2 commits
August 28, 2026 20:33
- Import jest from @jest/globals in failover-recovery tests that used the global (ReferenceError: jest is not defined) - Drop fake-timer usage that captured the mocked setTimeout and hung - Type logger.warn/debug spy calls to satisfy strict tsc - Export SCHEMA_MANAGER_INDEXES from db.ts and import it in the schema manager test (ReferenceError) - Make the Goldii-locks#186 migration-count assertion robust to future migrations - Accept opts argument in the indexer-runner-historical-sync getEvents mock
…cks#256) Implement dynamic polling frequency intervals in indexer_runner based on ledger processing load: - Add IndexerRunnerThrottleParameters / IndexerRunnerThrottleState with env-configured base/min/max intervals, idle multiplier, idle threshold and load decrease factor. - adjustIndexerRunnerPollInterval(): the polling wait delay backs off (increases) toward the max when the network is idle and is pulled back toward the min when events are processed. - Wire the poll loop (poller.ts) to size its sleep from the indexer_runner throttle instead of the generic db.ts throttle. Add tests asserting polling wait delays increase while the network is idle, including an integration test that drives pollEvents() through repeated idle cycles.
|
@ToryMic 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! 🚀 |
9e42e6f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements dynamic polling frequency intervals in
indexer_runnerbased on ledger processing loads.(
INDEXER_RUNNER_POLL_INTERVAL_MS,INDEXER_RUNNER_MIN/MAX_POLL_INTERVAL_MS,INDEXER_RUNNER_IDLE_MULTIPLIER,INDEXER_RUNNER_IDLE_THRESHOLD_CYCLES,INDEXER_RUNNER_LOAD_DECREASE_FACTOR).adjustIndexerRunnerPollInterval()backs the polling wait delay up toward themax interval while the network is idle and pulls it back toward the min when
events are processed.
poller.ts) now sizes its wait from the indexer_runner throttle.Validation
including an integration test that drives
pollEvents()through repeated idlecycles and asserts the delay grows.
tsc --noEmit,npm test(965 tests), andnpm run buildall pass.Also includes small repairs to pre-existing CI failures so this branch is green.
Closes 256
Closes #256