Repository navigation
fix: keep configured platforms when their node is unavailable - #4201
Open
codewith-aditya wants to merge 1 commit into
Open
codewith-aditya wants to merge 1 commit into
codewith-aditya wants to merge 1 commit into
Conversation
…s unavailable A node with an explicit platform that failed to initialize was dropped before platform resolution. A build requesting that platform could then land on an unrelated healthy node, or on a node that only reports the platform through worker discovery. Keep unavailable nodes in the resolver input, match explicitly configured platforms only against configured platforms, and take the default platform from the first node's configuration even when that node is down. Signed-off-by: Aditya Wakharkar <130750636+codewith-aditya@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #2119.
What
A node configured for an explicit platform could be dropped when it failed to initialize, so a build for that platform could run on an unrelated healthy node — including a node that only reports the platform through worker discovery.
With this change an unavailable configured node no longer changes the platform decision:
--platform, the first node's configured platform stays the default even when that node is unavailable.Why
filterAvailableNodesremoved failed nodes before resolution, so the resolver could not tell that the requested platform belonged to a node that was down. It fell back to the first available node, which is how anlinux/amd64build ended up on anlinux/arm64node.Tests
New resolver tests:
TestSelectNodeUnavailableManualPlatformFallsBackToSameManualPlatformTestSelectNodeUnavailableManualPlatformDoesNotUseDetectedPlatformTestSelectNodeNoPlatformUsesConfiguredPlatformOfUnavailableFirstNodeAll three fail against the previous code and pass with the change.
SKIP_INTEGRATION_TESTS=1 go test ./...,go vet ./build/...andgolangci-lint run ./build/...pass.