Use private batch API to avoid infinite queing#5140
Open
jonathanmetzman wants to merge 13 commits intomasterfrom
Open
Use private batch API to avoid infinite queing#5140jonathanmetzman wants to merge 13 commits intomasterfrom
jonathanmetzman wants to merge 13 commits intomasterfrom
Conversation
Added a mechanism to check current load (queued and scheduled jobs) in GCP Batch regions. The service now avoids scheduling tasks in regions with a high number of pending jobs (currently thresholded at 5). This is configurable via `queue_check_regions` in `batch.yaml`. This helps in distributing the load more evenly and avoiding delays when some regions are heavily utilized.
Added a mechanism to check current load (queued and scheduled jobs) in GCP Batch regions. The service now avoids scheduling tasks in regions with a high number of pending jobs (currently thresholded at 50). This is configurable via `queue_check_regions` in `batch.yaml`. Includes comprehensive unit tests for the load-balancing logic and API interaction.
Added a mechanism to check current load (queued and scheduled jobs) in GCP Batch regions. The service now avoids scheduling tasks in regions with a high number of pending jobs (currently thresholded at 50). This is configurable via `queue_check_regions` in `batch.yaml`. Includes comprehensive unit tests for the load-balancing logic and API interaction.
… bottleneck and fix bug filing backlog.
# Conflicts: # src/clusterfuzz/_internal/batch/service.py # src/clusterfuzz/_internal/tests/core/batch/batch_service_test.py
…e O(N^2) bottleneck and fix bug filing backlog." This reverts commit ad01cdd.
jonathanmetzman
commented
Jan 23, 2026
ViniciustCosta
approved these changes
Jan 23, 2026
| # See https://cloud.google.com/batch/quotas#job_limits | ||
| MAX_CONCURRENT_VMS_PER_JOB = 1000 | ||
|
|
||
| MAX_QUEUE_SIZE = 50 |
Collaborator
There was a problem hiding this comment.
Maybe this could be a config per project?
|
|
||
| if region in queue_check_regions: | ||
| load = get_region_load(project, region) | ||
| logs.info(f'Region {region} has {load} queued/scheduled jobs.') |
Collaborator
There was a problem hiding this comment.
nit: maybe return like -1 when the get_region_load() fails and check it before logging to avoid confusion by saying that the region has 0 queued.
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.
No description provided.