logtail: we missed a case for the backoff timer.

We want to run bo.Backoff() after every upload, regardless. If
upload==true but err!=nil, we weren't backing off, which caused some
very-high-throughput log upload retries in bad network conditions.

Updates #282.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
pull/443/head
Avery Pennarun 5 years ago
parent 1d2e497d47
commit 6f590f5b52

@ -273,10 +273,10 @@ func (l *logger) uploading(ctx context.Context) {
if err != nil { if err != nil {
fmt.Fprintf(l.stderr, "logtail: upload: %v\n", err) fmt.Fprintf(l.stderr, "logtail: upload: %v\n", err)
} }
l.bo.BackOff(ctx, err)
if uploaded { if uploaded {
break break
} }
l.bo.BackOff(ctx, err)
} }
select { select {

Loading…
Cancel
Save