tracing/plugin: newTracer: ignore context.Canceled errors on Close()
Before this, containerd would always print an error when shutting down; ERRO[2023-12-07T14:35:00.070333131Z] failed to close plugin error="context canceled" id=io.containerd.internal.v1.tracing Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2c8a996330
commit
22138541a2
@ -18,6 +18,7 @@ package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
@ -178,13 +179,12 @@ func newTracer(ctx context.Context, config *TraceConfig, procs []trace.SpanProce
|
||||
|
||||
return &closer{close: func() error {
|
||||
for _, p := range procs {
|
||||
if err := p.Shutdown(ctx); err != nil {
|
||||
if err := p.Shutdown(ctx); err != nil && !errors.Is(err, context.Canceled) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}}, nil
|
||||
|
||||
}
|
||||
|
||||
// Returns a composite TestMap propagator
|
||||
|
Loading…
Reference in New Issue
Block a user