Repository navigation
Try clouds in config order and skip clouds whose VM GCP recently rejected - #1
Draft
ATTA-E-MUSTAFA wants to merge 1 commit into
Draft
ATTA-E-MUSTAFA wants to merge 1 commit into
ATTA-E-MUSTAFA wants to merge 1 commit into
Conversation
…cted NoDelayProvisionerStrategy shuffled the clouds and stopped after the first matching one, even when it planned nothing. A build whose cloud GCP kept rejecting (zone exhausted, quota) waited on that cloud until it timed out. - Clouds are tried in their configured order, so the cheapest can be first. - When GCP rejects a VM create (operation error other than OPERATION_CANCELED_BY_USER, or an IOException from the insert call), the cloud is recorded in CloudFailureTracker and tried after all other clouds for 5 minutes (-Dcom.google.jenkins.plugins.computeengine.CloudFailureTracker.cooldownMinutes). - The dead agent of a rejected create is removed, so the waiting build is provisioned again on the next NodeProvisioner run. - A cloud that plans no node (at its cap, or refused) no longer ends the search; the next cloud is tried in the same run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Patch on top of 4.575.v6969b_7c435eb_, the version our controller runs (branch starts at that tag; the diff below is only the patch).
Problem
Our PR builds can run on three clouds that share a label: Toronto, Delhi and Milan, cheapest first. The plugin doesn't use that order:
NoDelayProvisionerStrategyshuffles the clouds and stops after the first one that serves the label, even when that cloud planned nothing.ZONE_RESOURCE_POOL_EXHAUSTED,QUOTA_EXCEEDED, ...),ComputeEngineComputerLauncheronly logs it. The dead agent stays, Jenkins counts it as capacity on its way, and the build waits on that cloud until it times out.Change
CloudFailureTrackerrecords a cloud when GCP rejects one of its VMs: an insert operation error other thanOPERATION_CANCELED_BY_USER(aborted builds), or anIOExceptionfrom the insert call itself. Such a cloud is tried after all other clouds for 5 minutes, then goes back to its place. Configure with-Dcom.google.jenkins.plugins.computeengine.CloudFailureTracker.cooldownMinutes=N. In memory only, so a restart resets it.NodeProvisionerrun, about 10s later, from the next cloud.Flow on a stockout
pr-pool. Order is Toronto, Delhi, Milan, so Toronto is asked.ZONE_RESOURCE_POOL_EXHAUSTED. Toronto is recorded and the agent is removed.Effect on today's config
Every label in our
jenkins.yamlis served by exactly one cloud, so ordering and cooldown change nothing until clouds share a label. The one immediate difference: an agent whose create GCP rejected is removed right away instead of lingering.Testing
CloudFailureTrackerTest: healthy by default, cooldown per cloud, recovery after the cooldown.mvn -Dchangelist=575.educative-1 package(e.g. inmaven:3.9-eclipse-temurin-17) and fix any spotless/spotbugs findings.4.575.educative-1and confirm builds behave as today.pr-poollabel topr,pr-1,pr-2, plus Testing-Haider first with a machine type GCP rejects. Check the system log showsCloud gce-Testing-Haider could not create a VM (...)and the build lands on apr-*agent within ~20s.Rollout notes
config/plugins.txtin educative/jenkins:google-compute-engine:4.575.educative-1:<release .hpi URL>.fallbackZones.🤖 Generated with Claude Code