mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
deps: update buildkit, vendor changes
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
7
vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc/client.go
generated
vendored
7
vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc/client.go
generated
vendored
@ -70,9 +70,10 @@ func (c *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc
|
||||
}
|
||||
|
||||
ctx, cancel := c.connection.ContextWithStop(ctx)
|
||||
defer cancel()
|
||||
ctx, tCancel := context.WithTimeout(ctx, 30*time.Second)
|
||||
defer tCancel()
|
||||
defer cancel(errors.WithStack(context.Canceled))
|
||||
ctx, tCancel := context.WithCancelCause(ctx)
|
||||
ctx, _ = context.WithTimeoutCause(ctx, 30*time.Second, errors.WithStack(context.DeadlineExceeded))
|
||||
defer tCancel(errors.WithStack(context.Canceled))
|
||||
|
||||
ctx = c.connection.ContextWithMetadata(ctx)
|
||||
err := func() error {
|
||||
|
11
vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc/connection.go
generated
vendored
11
vendor/github.com/moby/buildkit/util/tracing/otlptracegrpc/connection.go
generated
vendored
@ -22,6 +22,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
@ -185,7 +186,7 @@ func (c *Connection) Shutdown(ctx context.Context) error {
|
||||
select {
|
||||
case <-c.backgroundConnectionDoneCh:
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
}
|
||||
|
||||
c.mu.Lock()
|
||||
@ -200,17 +201,17 @@ func (c *Connection) Shutdown(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Connection) ContextWithStop(ctx context.Context) (context.Context, context.CancelFunc) {
|
||||
func (c *Connection) ContextWithStop(ctx context.Context) (context.Context, context.CancelCauseFunc) {
|
||||
// Unify the parent context Done signal with the Connection's
|
||||
// stop channel.
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
go func(ctx context.Context, cancel context.CancelFunc) {
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
go func(ctx context.Context, cancel context.CancelCauseFunc) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
// Nothing to do, either cancelled or deadline
|
||||
// happened.
|
||||
case <-c.stopCh:
|
||||
cancel()
|
||||
cancel(errors.WithStack(context.Canceled))
|
||||
}
|
||||
}(ctx, cancel)
|
||||
return ctx, cancel
|
||||
|
Reference in New Issue
Block a user