perf(actions): debounce runner heartbeat writes and throttle task picks#38281
Open
bircni wants to merge 1 commit into
Open
perf(actions): debounce runner heartbeat writes and throttle task picks#38281bircni wants to merge 1 commit into
bircni wants to merge 1 commit into
Conversation
Two runner-poll load reductions that need no DB schema changes: - Debounce last_online/last_active: skip the per-poll and per-UpdateLog runner status writes, persisting only when stale enough to affect the active/offline status (ShouldPersistLastOnline/ShouldPersistLastActive). - Bound concurrent task-pick transactions with an in-process semaphore (MAX_CONCURRENT_TASK_PICKS) so a fleet polling together can't stampede the assignment query; throttled polls retry without advancing the runner's tasks version. Assisted-by: Claude:claude-opus-4-8
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.
Split out of #38150, which is being broken into smaller, independently reviewable PRs. This one contains the parts that need no database schema change and can be reviewed/merged on its own.
Two reductions in the DB load generated by many runners polling
FetchTask:1. Debounce runner heartbeat writes
Every poll wrote
last_online, and everyUpdateTask/UpdateLogwrotelast_active— while a runner streams logs that is many writes per second per runner. These are now persisted only when stale enough to actually affect the active/offline status (ShouldPersistLastOnline/ShouldPersistLastActive), using the existing columns.2. Throttle concurrent task picks
A new in-process semaphore (
MAX_CONCURRENT_TASK_PICKS) bounds how many runners run the task-assignment transaction at once, so a fleet polling together cannot stampede the query. Throttled polls retry on their next poll without advancing the runner's tasks version.No migration — uses existing columns and adds one config option.