From f1ef16c736b477be17f6bc1bce18d0958a87d840 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Mon, 6 Aug 2018 21:39:56 +0000 Subject: [PATCH] builder: do not cancel buildkit status request This fixes a bug when the build results in an error and instead of sending the logs of the container to the client, it signals a cancelation. The context should not be wired to the status request, as only the build requests need to be canceled. Signed-off-by: Tibor Vass --- builder/builder-next/builder.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/builder-next/builder.go b/builder/builder-next/builder.go index dacec0af67..fffac64232 100644 --- a/builder/builder-next/builder.go +++ b/builder/builder-next/builder.go @@ -258,9 +258,10 @@ func (b *Builder) Build(ctx context.Context, opt backend.BuildConfig) (*builder. eg.Go(func() error { defer close(ch) - return b.controller.Status(&controlapi.StatusRequest{ - Ref: id, - }, &statusProxy{streamProxy: streamProxy{ctx: ctx}, ch: ch}) + // streamProxy.ctx is not set to ctx because when request is cancelled, + // only the build request has to be cancelled, not the status request. + stream := &statusProxy{streamProxy: streamProxy{ctx: context.TODO()}, ch: ch} + return b.controller.Status(&controlapi.StatusRequest{Ref: id}, stream) }) eg.Go(func() error {