Skip to content

driver: propagate feature detection errors - #4085

Merged
tonistiigi merged 1 commit into
docker:masterfrom
crazy-max:fix-driver-feature-detection
Sep 30, 2026
Merged

tonistiigi merged 1 commit into
docker:masterfrom
crazy-max:fix-driver-feature-detection

Conversation

@crazy-max

@crazy-max crazy-max commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

needs #4082
fixes #3266

Address the Docker driver ListWorkers feature cache. Return detection errors through the driver interface and cache only successful results, so transient failures can be retried without being mistaken for unsupported capabilities.

This was deferred from #4082 because safely retrying failed probes requires updating the driver interface and its callers. Without error propagation, an early failure could disable default provenance while a later successful probe allows the build to proceed without it. Resolve features before constructing build options and reuse the successful result for capability checks, ensuring detection failures stop the build instead of silently changing its output.

Return feature detection errors through the driver interface and cache only
successful Docker worker probes so transient failures can be retried.

Resolve features before constructing build options and reuse that result for
capability checks. This prevents failed probes from silently disabling default
provenance before a later successful probe allows the build to proceed. Report
detection failures in debug inspection and cover retries, caching, and
provenance preservation.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-max force-pushed the fix-driver-feature-detection branch from 8ee4cac to 4b5e0a2 Compare September 30, 2026 13:31

@jsternberg jsternberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One comment to just assess my understanding of the PR but LGTM if my understanding is correct.

Comment thread driver/docker/driver.go
}, nil
})
return d.features.list
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So the main thing here is changing this specific driver to make a new request each time the method is called rather than using once to only call it once and then changing the places that call this to avoid treating this as a "free" call because it no longer caches the result.

I think this is fine I just wanted to confirm that I was understanding the intent correctly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes almost 😅 Features still caches a successful ListWorkers result, so later calls don't make another request. The change is that a failed probe returns an error without caching "unsupported"; a subsequent call can retry. Build option setup uses one successful result for its capability checks, including provenance, so those decisions stay consistent.

@tonistiigi
tonistiigi merged commit 29f4d63 into docker:master Sep 30, 2026
162 checks passed
@crazy-max
crazy-max deleted the fix-driver-feature-detection branch September 30, 2026 19:55
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.

Feature detection caches features as not available if a builder is polled before it is fully initialized

3 participants