Skip to content

build: wait for docker load progress cleanup - #4064

Open
crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-load-progress-close
Open

build: wait for docker load progress cleanup#4064
crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-load-progress-close

Conversation

@crazy-max

Copy link
Copy Markdown
Member

fixes #3948
closes #4056

--load can stream Docker import progress after the solve has already started cleaning up. When that happens, the import goroutine can still write to the build progress printer while the printer is being closed, which can panic with send on closed channel.

This fixes the lifecycle ordering by joining the Docker load writer during solve cleanup, before the command waits on the printer. It also makes the load writer close path safe when BuildKit never opened the writer, so cleanup can always call it without hanging.

I took this over from #4056 because the original PR mixed the correct lifecycle fix with a broader Printer.Write recovery path. Catching send on closed channel with recover would hide progress writer ownership bugs globally and make the printer contract weaker than it needs to be.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max added this to the v0.38.0 milestone Sep 9, 2026
@crazy-max
crazy-max requested a review from tonistiigi September 9, 2026 10:06
@crazy-max
crazy-max marked this pull request as ready for review September 9, 2026 10:07
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.

panic: send on closed channel in Printer.Write via LoadImage (--load) progress after solve completes

1 participant