summaryrefslogtreecommitdiffhomepage
path: root/logtail/backoff
AgeCommit message (Collapse)AuthorFilesLines
2024-06-05all: use math/rand/v2 moreMaisem Ali1-1/+1
Updates #11058 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2024-05-23logtail/backoff: update Backoff.BackOff docs (#12229)Jordan Whited1-3/+2
Update #cleanup Signed-off-by: Jordan Whited <jordan@tailscale.com>
2023-07-21logtail: use tstime (#8607)Claire Wang1-6/+6
Updates #8587 Signed-off-by: Claire Wang <claire@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-02-12all: adjust some log verbosityBrad Fitzpatrick1-1/+1
Updates #1548 Change-Id: Ia55f1b5dc7dfea09a08c90324226fb92cd10fa00 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-08-09backoff: update to Go style, document a bit, make 30s explicitBrad Fitzpatrick1-34/+51
Also, bit of behavior change: on non-nil err but expired context, don't reset the consecutive failure count. I don't think the old behavior was intentional. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-05-13Add tstest.PanicOnLog(), and fix various problems detected by this.Avery Pennarun1-8/+15
If a test calls log.Printf, 'go test' horrifyingly rearranges the output to no longer be in chronological order, which makes debugging virtually impossible. Let's stop that from happening by making log.Printf panic if called from any module, no matter how deep, during tests. This required us to change the default error handler in at least one http.Server, as well as plumbing a bunch of logf functions around, especially in magicsock and wgengine, but also in logtail and backoff. To add insult to injury, 'go test' also rearranges the output when a parent test has multiple sub-tests (all the sub-test's t.Logf is always printed after all the parent tests t.Logf), so we need to screw around with a special Logf that can point at the "current" t (current_t.Logf) in some places. Probably our entire way of using subtests is wrong, since 'go test' would probably like to run them all in parallel if you called t.Parallel(), but it definitely can't because the're all manipulating the shared state created by the parent test. They should probably all be separate toplevel tests instead, with common setup/teardown logic. But that's a job for another time. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-04-29backoff: add a LogLongerThan configuration.Avery Pennarun1-4/+11
Some programs use frequent short-duration backoffs even under non-error conditions. They can set this to avoid logging short backoffs when things are operating normally, but still get messages when longer backoffs kick in. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-04-29logtail/backoff: only log backoffs > 2secDavid Crawshaw1-1/+3
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-02-09Move Linux client & common packages into a public repo.Earl Lee1-0/+49