Skip to content

build: preserve shared clients across linked target completion - #4073

Merged
tonistiigi merged 1 commit into
docker:masterfrom
crazy-max:fix-linked-target-client-lifetime
Sep 10, 2026
Merged

build: preserve shared clients across linked target completion#4073
tonistiigi merged 1 commit into
docker:masterfrom
crazy-max:fix-linked-target-client-lifetime

Conversation

@crazy-max

@crazy-max crazy-max commented Sep 10, 2026

Copy link
Copy Markdown
Member

fixes #4063

With the Kubernetes driver and loadbalance=random, linked Bake targets share a client so they reach the same BuildKit instance. That client was created with one target's errgroup context, which is canceled when the target finishes, even on success. Because the Kubernetes exec connection uses that context, completing one target could disconnect siblings still building through the shared client.

Create the shared client with the enclosing build context so its connection remains alive until the overall build completes or is canceled.

Create shared clients with the enclosing build context so completing one linked target doesn't
cancel the Kubernetes connection still used by its siblings.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@tonistiigi
tonistiigi merged commit 393d6df into docker:master Sep 10, 2026
163 checks passed
@crazy-max
crazy-max deleted the fix-linked-target-client-lifetime branch September 10, 2026 17:31
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.

driver/kubernetes: sibling solves in one bake die mid-build when another solve's session closes

2 participants