Skip to content

Commit bb857a0

Browse files
authored
Merge pull request moby#4088 from tonistiigi/v0.12.1-picks
[v0.12.1] cherry-picks
2 parents 2556ec9 + 5d53119 commit bb857a0

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

cmd/buildkitd/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,8 @@ func newController(c *cli.Context, cfg *config.Config) (*control.Controller, err
663663
if tc != nil {
664664
traceSocket = traceSocketPath(cfg.Root)
665665
if err := runTraceController(traceSocket, tc); err != nil {
666-
return nil, err
666+
logrus.Warnf("failed set up otel-grpc controller: %v", err)
667+
traceSocket = ""
667668
}
668669
}
669670

executor/resources/monitor.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func (r *cgroupRecord) Start() {
5656
r.closeSampler = s.Close
5757
}
5858

59+
func (r *cgroupRecord) Close() {
60+
r.close()
61+
}
62+
5963
func (r *cgroupRecord) CloseAsync(next func(context.Context) error) error {
6064
go func() {
6165
r.close()
@@ -160,6 +164,9 @@ func (r *nopRecord) Samples() (*types.Samples, error) {
160164
return nil, nil
161165
}
162166

167+
func (r *nopRecord) Close() {
168+
}
169+
163170
func (r *nopRecord) CloseAsync(next func(context.Context) error) error {
164171
return next(context.TODO())
165172
}

executor/resources/types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
type Recorder interface {
1111
Start()
12+
Close()
1213
CloseAsync(func(context.Context) error) error
1314
Wait() error
1415
Samples() (*Samples, error)

executor/runcexecutor/executor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ func (w *runcExecutor) Run(ctx context.Context, id string, root executor.Mount,
335335

336336
err = exitError(ctx, err)
337337
if err != nil {
338+
if rec != nil {
339+
rec.Close()
340+
}
338341
releaseContainer(context.TODO())
339342
return nil, err
340343
}

0 commit comments

Comments
 (0)