Skip to content

fix: keep configured platforms when their node is unavailable - #4201

Open
codewith-aditya wants to merge 1 commit into
docker:masterfrom
codewith-aditya:fix/manual-platform-node-fallback
Open

codewith-aditya wants to merge 1 commit into
docker:masterfrom
codewith-aditya:fix/manual-platform-node-fallback

Conversation

@codewith-aditya

@codewith-aditya codewith-aditya commented Nov 5, 2026 •

Copy link
Copy Markdown

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:

  • a requested platform that matches a configured platform is matched only against other nodes configured for that platform;
  • if no such node is available, the build fails instead of falling back to a detected platform or another node;
  • with no --platform, the first node's configured platform stays the default even when that node is unavailable.

Why

filterAvailableNodes removed 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 an linux/amd64 build ended up on an linux/arm64 node.

Tests

New resolver tests:

  • TestSelectNodeUnavailableManualPlatformFallsBackToSameManualPlatform
  • TestSelectNodeUnavailableManualPlatformDoesNotUseDetectedPlatform
  • TestSelectNodeNoPlatformUsesConfiguredPlatformOfUnavailableFirstNode

All three fail against the previous code and pass with the change. SKIP_INTEGRATION_TESTS=1 go test ./..., go vet ./build/... and golangci-lint run ./build/... pass.

…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>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multi-node builder should not fallback to detected platform if node with manual platform errors

2 participants