Commit Graph

24 Commits

Author SHA1 Message Date
Jonathan A. Sternberg
1a3fc0aa15 protobuf: remove gogoproto
Remove gogoproto in favor of the standard protobuf compiler. This
removes any nonstandard extensions that were part of gogoproto such as
the custom types.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-09-26 12:57:45 -05:00
Brian Goff
bffd55831d Always return non-nil contexts
This prevents cases where the returned nil context ends up overwriting
another context in the caller which can mess up defers.

Ex:

```go
ctx := context.Background()

defer func() {
  cleanup(ctx)
}()

ctx, done, err := leaseutil.WithLease(...)
```

In this cae when `leaseutil.WithLease` has an error, before this change
the returned context is nil.
The solver this can trigger a panic when the context is cancelled
because leaseutil will error out and then a prior defer function will
call `context.WithoutCancel(ctx)` triggering the panic because context
should never be nil.

leaseutil seems like the only place this was problematic but changed a
couple of other places I found to make sure they don't cause problems if
the caller changes in the future.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-07-02 19:51:06 +00:00
Jonathan A. Sternberg
c3105e49d9 otel: update usage of otelgrpc interceptors to use stat handlers
The otelgrpc interceptors were deprecated. This updates the areas where
these were used to use the stat handlers instead of the interceptors.
This helps with creating a single method for both unary and stream rpcs
and also ensures we aren't using a deprecated function for the future.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-03-29 16:39:25 -05:00
Sebastiaan van Stijn
841e397d54 vendor: OTEL v0.46.1 / v1.21.0
Temporarily adding some "nolint" tags, and a TODO for replacing some
deprecated features;

    client/client.go:105:43: SA1019: otelgrpc.UnaryClientInterceptor is deprecated: Use [NewClientHandler] instead. (staticcheck)
            unary = append(unary, filterInterceptor(otelgrpc.UnaryClientInterceptor(otelgrpc.WithTracerProvider(tracerProvider), otelgrpc.WithPropagators(propagators))))
                                                    ^
    client/client.go:106:27: SA1019: otelgrpc.StreamClientInterceptor is deprecated: Use [NewClientHandler] instead. (staticcheck)
            stream = append(stream, otelgrpc.StreamClientInterceptor(otelgrpc.WithTracerProvider(tracerProvider), otelgrpc.WithPropagators(propagators)))
                                    ^
    solver/jobs.go:515:13: SA1019: trace.NewNoopTracerProvider is deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider] instead. (staticcheck)
        _, span := trace.NewNoopTracerProvider().Tracer("").Start(ctx, "")
                   ^
    util/tracing/detect/detect.go:108:7: SA1019: trace.NewNoopTracerProvider is deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider] instead. (staticcheck)
        tp = trace.NewNoopTracerProvider()
             ^
    cmd/buildkitd/main.go:273:19: SA1019: otelgrpc.StreamServerInterceptor is deprecated: Use [NewServerHandler] instead. (staticcheck)
            streamTracer := otelgrpc.StreamServerInterceptor(
                            ^
    cmd/buildkitd/main.go:664:15: SA1019: otelgrpc.UnaryServerInterceptor is deprecated: Use [NewServerHandler] instead. (staticcheck)
        withTrace := otelgrpc.UnaryServerInterceptor(
                     ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-02-22 18:46:05 +01:00
Tonis Tiigi
09648f4d29 replace WithTimeout with WithTimeoutCause
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-12-06 22:15:12 -08:00
Tonis Tiigi
8a2a3e83ec replace context.WithCancel with WithCancelCause
Keep stack traces for cancellation errors where possible.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-12-06 22:15:06 -08:00
Tonis Tiigi
ac33aec24e session: raise grpc message size limits for session endpoint
These limits were already set for control API requests but
not for session requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-10-09 18:23:56 -07:00
Tonis Tiigi
de53eb0072 session: avoid logging healthcheck error on canceled connection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-05-18 23:20:50 -07:00
Erik Sipsma
dd53dca59c Add trace logs for cache leaks.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2023-05-15 16:03:29 -07:00
Corey Larson
b63786184b Add config, logging for healthcheck
Signed-off-by: Corey Larson <corey@earthly.dev>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-08-19 18:34:41 -07:00
CrazyMax
39f6b4e739 Bump github.com/containerd/containerd to v1.6.0-rc.1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-01-28 10:18:59 +01:00
Morlay
18b49fd7dc refactor to use util/bklog instead of using logurs directly
Signed-off-by: Morlay <morlay.null@gmail.com>
2021-07-13 11:42:31 +08:00
Tonis Tiigi
7489cc8be0 vendor: update opentelemetry to 1.0.0-rc
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-19 10:02:26 -07:00
Tonis Tiigi
b10f25944b correctly validate span from context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Tonis Tiigi
9717e62b78 session: avoid tracing health checkpoint
Upstream fixes needed for cleaner solution

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Tonis Tiigi
8f50bae3f1 replace opentracing with opentelemetry tracers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Ximo Guanter
da8ebc8a39 Make HTTP/2 authority pseudo-header spec-compliant
Signed-off-by: Ximo Guanter <ximo.guanter@gmail.com>
2020-10-03 22:58:21 +02:00
Tonis Tiigi
bd3354fea3 session: avoid deprecated grpc.Stream type
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:36 -07:00
Tonis Tiigi
725f5e1207 grpc interceptors for errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-22 18:31:32 -07:00
Tonis Tiigi
6e40e83d35 Remove net/context dependencies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-17 09:11:22 -08:00
Tonis Tiigi
29b72a3912 solver: add some trace points
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-08 18:03:12 -08:00
Tonis Tiigi
b94704e55c session: fix session closing and tracing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-01-08 18:03:06 -08:00
Derek McGowan
9ce5053a8b Update containerd version
Fix for logrus rename, use fork until fixed in moby.
Removed unused tar stream.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-26 11:07:45 -07:00
Tonis Tiigi
fed5c1d9ce session: copy over session package from moby/moby
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-07-12 22:32:44 -07:00