mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
deps: update buildkit, vendor changes
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
4
vendor/github.com/moby/buildkit/session/filesync/filesync.go
generated
vendored
4
vendor/github.com/moby/buildkit/session/filesync/filesync.go
generated
vendored
@ -195,8 +195,8 @@ func FSSync(ctx context.Context, c session.Caller, opt FSSendRequestOpt) error {
|
||||
|
||||
opts[keyDirName] = []string{opt.Name}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
|
||||
client := NewFileSyncClient(c.Conn())
|
||||
|
||||
|
5
vendor/github.com/moby/buildkit/session/group.go
generated
vendored
5
vendor/github.com/moby/buildkit/session/group.go
generated
vendored
@ -72,8 +72,9 @@ func (sm *Manager) Any(ctx context.Context, g Group, f func(context.Context, str
|
||||
return errors.Errorf("no active sessions")
|
||||
}
|
||||
|
||||
timeoutCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
timeoutCtx, cancel := context.WithCancelCause(ctx)
|
||||
timeoutCtx, _ = context.WithTimeoutCause(timeoutCtx, 5*time.Second, errors.WithStack(context.DeadlineExceeded))
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
c, err := sm.Get(timeoutCtx, id, false)
|
||||
if err != nil {
|
||||
lastErr = err
|
||||
|
12
vendor/github.com/moby/buildkit/session/grpc.go
generated
vendored
12
vendor/github.com/moby/buildkit/session/grpc.go
generated
vendored
@ -74,14 +74,14 @@ func grpcClientConn(ctx context.Context, conn net.Conn) (context.Context, *grpc.
|
||||
return nil, nil, errors.Wrap(err, "failed to create grpc client")
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
go monitorHealth(ctx, cc, cancel)
|
||||
|
||||
return ctx, cc, nil
|
||||
}
|
||||
|
||||
func monitorHealth(ctx context.Context, cc *grpc.ClientConn, cancelConn func()) {
|
||||
defer cancelConn()
|
||||
func monitorHealth(ctx context.Context, cc *grpc.ClientConn, cancelConn func(error)) {
|
||||
defer cancelConn(errors.WithStack(context.Canceled))
|
||||
defer cc.Close()
|
||||
|
||||
ticker := time.NewTicker(5 * time.Second)
|
||||
@ -104,9 +104,11 @@ func monitorHealth(ctx context.Context, cc *grpc.ClientConn, cancelConn func())
|
||||
healthcheckStart := time.Now()
|
||||
|
||||
timeout := time.Duration(math.Max(float64(defaultHealthcheckDuration), float64(lastHealthcheckDuration)*1.5))
|
||||
ctx, cancel := context.WithTimeout(ctx, timeout)
|
||||
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
ctx, _ = context.WithTimeoutCause(ctx, timeout, errors.WithStack(context.DeadlineExceeded))
|
||||
_, err := healthClient.Check(ctx, &grpc_health_v1.HealthCheckRequest{})
|
||||
cancel()
|
||||
cancel(errors.WithStack(context.Canceled))
|
||||
|
||||
lastHealthcheckDuration = time.Since(healthcheckStart)
|
||||
logFields := logrus.Fields{
|
||||
|
10
vendor/github.com/moby/buildkit/session/manager.go
generated
vendored
10
vendor/github.com/moby/buildkit/session/manager.go
generated
vendored
@ -99,8 +99,8 @@ func (sm *Manager) HandleConn(ctx context.Context, conn net.Conn, opts map[strin
|
||||
|
||||
// caller needs to take lock, this function will release it
|
||||
func (sm *Manager) handleConn(ctx context.Context, conn net.Conn, opts map[string][]string) error {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
|
||||
opts = canonicalHeaders(opts)
|
||||
|
||||
@ -156,8 +156,8 @@ func (sm *Manager) Get(ctx context.Context, id string, noWait bool) (Caller, err
|
||||
id = p[1]
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
@ -173,7 +173,7 @@ func (sm *Manager) Get(ctx context.Context, id string, noWait bool) (Caller, err
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
sm.mu.Unlock()
|
||||
return nil, errors.Wrapf(ctx.Err(), "no active session for %s", id)
|
||||
return nil, errors.Wrapf(context.Cause(ctx), "no active session for %s", id)
|
||||
default:
|
||||
}
|
||||
var ok bool
|
||||
|
6
vendor/github.com/moby/buildkit/session/session.go
generated
vendored
6
vendor/github.com/moby/buildkit/session/session.go
generated
vendored
@ -42,7 +42,7 @@ type Session struct {
|
||||
name string
|
||||
sharedKey string
|
||||
ctx context.Context
|
||||
cancelCtx func()
|
||||
cancelCtx func(error)
|
||||
done chan struct{}
|
||||
grpcServer *grpc.Server
|
||||
conn net.Conn
|
||||
@ -107,11 +107,11 @@ func (s *Session) Run(ctx context.Context, dialer Dialer) error {
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
s.cancelCtx = cancel
|
||||
s.done = make(chan struct{})
|
||||
|
||||
defer cancel()
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
defer close(s.done)
|
||||
|
||||
meta := make(map[string][]string)
|
||||
|
4
vendor/github.com/moby/buildkit/session/sshforward/copy.go
generated
vendored
4
vendor/github.com/moby/buildkit/session/sshforward/copy.go
generated
vendored
@ -39,7 +39,7 @@ func Copy(ctx context.Context, conn io.ReadWriteCloser, stream Stream, closeStre
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
conn.Close()
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
default:
|
||||
}
|
||||
if _, err := conn.Write(p.Data); err != nil {
|
||||
@ -65,7 +65,7 @@ func Copy(ctx context.Context, conn io.ReadWriteCloser, stream Stream, closeStre
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
default:
|
||||
}
|
||||
p := &BytesMessage{Data: buf[:n]}
|
||||
|
2
vendor/github.com/moby/buildkit/session/sshforward/ssh.go
generated
vendored
2
vendor/github.com/moby/buildkit/session/sshforward/ssh.go
generated
vendored
@ -26,7 +26,7 @@ func (s *server) run(ctx context.Context, l net.Listener, id string) error {
|
||||
|
||||
eg.Go(func() error {
|
||||
<-ctx.Done()
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
})
|
||||
|
||||
eg.Go(func() error {
|
||||
|
Reference in New Issue
Block a user