Skip to content

[Swarming] Give non-fuzz tasks higher queue and pending backpressure limits - #5676

Open
Xeicker wants to merge 2 commits into
feature/swarming/per-platform-backpressurefrom
feature/swarming/non-fuzz-backpressure
Open

Xeicker wants to merge 2 commits into
feature/swarming/per-platform-backpressurefrom
feature/swarming/non-fuzz-backpressure

Conversation

@Xeicker

@Xeicker Xeicker commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Bug: 589717890

Context

Even when non-fuzz tasks (analyze, minimize, regression, progression, etc.) have higher Swarming priority, continuous fuzz traffic holds both backpressure gates at the 25-task default: trusted workers reject non-fuzz preprocessing with QueueLimitReachedError, and the Swarming scheduler holds non-fuzz tasks once pending tasks hit 25.

Removing the cap completely for non-fuzz tasks would leave Swarming open to unbounded floods that sit until Swarming's 24-hour expiration and signed URL timeout.

Fix description

Give Swarming non-fuzz tasks dedicated headroom above fuzz while keeping both gates bounded and live-tunable:

  • Added the swarming_non_fuzz_queue_limit_multiplier feature flag (default 2.0, clamped to >= 1.0, no Datastore entry required unless overriding the default) and get_swarming_non_fuzz_queue_limit helper. Scaling the base cap keeps headroom proportional across environments and preserves 0 as an emergency stop for both tiers.
  • Applied the scaled limit to Swarming non-fuzz commands at both the preprocessing queue gate (UTask.execute) and the Swarming pending-task check (SwarmingService._is_queue_full), leaving Cloud Batch jobs unchanged.
  • Extended the per-batch full_queues key in SwarmingService.create_utask_main_jobs to (pool, os, is_fuzz) so a full fuzz bucket does not block non-fuzz tasks for the same platform.

Tests

  • Added test_get_swarming_non_fuzz_queue_limit in pub_sub_task_queue_test.py covering the default 2.0 multiplier, enabled flag overrides, and the >= 1.0 clamp.
  • Added test_swarming_non_fuzz_gets_higher_queue_limit in task_types_test.py verifying Swarming fuzz blocks at 26 while analyze passes at 26 and blocks at 51.
  • Updated service_test.py to verify a mixed batch schedules Linux analyze (at 25 < 50) and Mac fuzz (at 0 < 25) while skipping repeat Linux fuzz via full_queues and capping Linux analyze at 50.
  • Ran pub_sub_task_queue_test.py (5/5), task_types_test.py (25 run, 1 pre-existing skip), and service_test.py (16/16), plus python butler.py format and python butler.py lint (passing).

@Xeicker
Xeicker requested review from a team as code owners November 30, 2026 19:55
@Xeicker
Xeicker added this pull request to stack #5677 November 30, 2026 19:55
@g-ortuno

Copy link
Copy Markdown
Collaborator

Does this match Batch? If not, is there a reason why this is not a problem for batch?

@Xeicker

Xeicker commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Does this match Batch? If not, is there a reason why this is not a problem for batch?

No, Batch doesn't do this. If all Batch regions hit MAX_QUEUE_SIZE (100 queued jobs) or utask_main hits 10,000, Batch would block non-fuzz tasks too (AllRegionsOverloadedError returns the whole batch). In practice Batch rarely stays pinned at those caps because it provisions VMs on demand across regions (and separates preemptible fuzz from non-preemptible non-fuzz), whereas Swarming runs on a small fixed bot pool that is saturated in steady state.

@g-ortuno

Copy link
Copy Markdown
Collaborator

Thanks for the context!

…limits

Scale the Swarming utask_main queue limit and Swarming pending task backpressure limit for non-fuzz commands using the live-tunable swarming_non_fuzz_queue_limit_multiplier feature flag (default 2.0, clamped to >= 1.0), and extend per-batch backpressure keys to (os, is_fuzz).

Bug: 589717890
@Xeicker
Xeicker force-pushed the feature/swarming/non-fuzz-backpressure branch from e6c2081 to 7bc8312 Compare November 30, 2026 22:46

This branch has not been deployed

No deployments
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