diff options
| author | Andrew Dunham <andrew@du.nham.ca> | 2024-11-26 17:24:24 -0500 |
|---|---|---|
| committer | Andrew Dunham <andrew@du.nham.ca> | 2024-11-26 18:05:27 -0500 |
| commit | 63b6a19ffa54941d0be274d15c7b6def80dfc36c (patch) | |
| tree | 978da024344b3d62b27d70fcd534800cc31085ae /control/controlhttp | |
| parent | e87b71ec3c7bded3fadf44cb9374df5de5e213d6 (diff) | |
| download | tailscale-andrew/context-dedup-errors.tar.xz tailscale-andrew/context-dedup-errors.zip | |
control/controlhttp, util/multierr: deduplicate context errorsandrew/context-dedup-errors
Add a new function to the util/multierr package that allows
deduplicating the `context.Canceled` and `context.DeadlineExceeded`
errors from a slice, and then use that to reduce log spam in
controlhttp.
Updates #14233
Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I5a121124fe27c4449705ba35de6faf83665db5fe
Diffstat (limited to 'control/controlhttp')
| -rw-r--r-- | control/controlhttp/client.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/control/controlhttp/client.go b/control/controlhttp/client.go index 9b1d5a1a5..bf8d973e7 100644 --- a/control/controlhttp/client.go +++ b/control/controlhttp/client.go @@ -246,7 +246,7 @@ func (a *Dialer) dial(ctx context.Context) (*ClientConn, error) { results[i].conn = nil // so we don't close it in the defer return conn, nil } - merr := multierr.New(errs...) + merr := multierr.New(multierr.DeduplicateContextErrors(errs)...) // If we get here, then we didn't get anywhere with our dial plan; fall back to just using DNS. a.logf("controlhttp: failed dialing using DialPlan, falling back to DNS; errs=%s", merr.Error()) |
