From 5674c2d470723e1358af966a80d55cd2223dacea Mon Sep 17 00:00:00 2001 From: coryb Date: Wed, 20 Jul 2022 09:05:48 -0700 Subject: [PATCH] do not close sessions after client solve if pre-initialized This fixes what appears to be a bug from an old refactor to allow shared sessions: https://github.com/moby/buildkit/commit/ef58b61d83f9030f54355ef0b68424ef8519fd75 Without this, the session cannot really be shared effectively. Signed-off-by: coryb --- client/solve.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/solve.go b/client/solve.go index c0b1b29050c0..5d9f187e5b8f 100644 --- a/client/solve.go +++ b/client/solve.go @@ -209,8 +209,10 @@ func (c *Client) solve(ctx context.Context, def *llb.Definition, runGateway runG <-time.After(3 * time.Second) cancelStatus() }() - bklog.G(ctx).Debugf("stopping session") - s.Close() + if !opt.SessionPreInitialized { + bklog.G(ctx).Debugf("stopping session") + s.Close() + } }() var pbd *pb.Definition if def != nil {