Skip to content

Commit

Permalink
Merge pull request #4088 from tonistiigi/v0.12.1-picks
Browse files Browse the repository at this point in the history
[v0.12.1] cherry-picks
  • Loading branch information
tonistiigi authored Aug 2, 2023
2 parents 2556ec9 + 5d53119 commit bb857a0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/buildkitd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@ func newController(c *cli.Context, cfg *config.Config) (*control.Controller, err
if tc != nil {
traceSocket = traceSocketPath(cfg.Root)
if err := runTraceController(traceSocket, tc); err != nil {
return nil, err
logrus.Warnf("failed set up otel-grpc controller: %v", err)
traceSocket = ""
}
}

Expand Down
7 changes: 7 additions & 0 deletions executor/resources/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func (r *cgroupRecord) Start() {
r.closeSampler = s.Close
}

func (r *cgroupRecord) Close() {
r.close()
}

func (r *cgroupRecord) CloseAsync(next func(context.Context) error) error {
go func() {
r.close()
Expand Down Expand Up @@ -160,6 +164,9 @@ func (r *nopRecord) Samples() (*types.Samples, error) {
return nil, nil
}

func (r *nopRecord) Close() {
}

func (r *nopRecord) CloseAsync(next func(context.Context) error) error {
return next(context.TODO())
}
Expand Down
1 change: 1 addition & 0 deletions executor/resources/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

type Recorder interface {
Start()
Close()
CloseAsync(func(context.Context) error) error
Wait() error
Samples() (*Samples, error)
Expand Down
3 changes: 3 additions & 0 deletions executor/runcexecutor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ func (w *runcExecutor) Run(ctx context.Context, id string, root executor.Mount,

err = exitError(ctx, err)
if err != nil {
if rec != nil {
rec.Close()
}
releaseContainer(context.TODO())
return nil, err
}
Expand Down

0 comments on commit bb857a0

Please sign in to comment.