Skip to content

Commit 736238e

Browse files
authored
Merge pull request #412 from nblumhardt/throttle-unauthorized
Apply exponential back-off to log shipping on non-Exception failures, too
2 parents e00098f + 72def6d commit 736238e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/SeqCli/Ingestion/LogShipper.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ public static async Task ShipBufferAsync(
8585
}
8686
catch (Exception ex)
8787
{
88-
var millisecondsDelay = (int)Math.Min(Math.Pow(2, retries) * 2000, 60000);
89-
sendFailureLog.Error(ex, "Failed to send an event batch; retry in {MillisecondsDelay}", millisecondsDelay);
90-
91-
await Task.Delay(millisecondsDelay, cancellationToken);
92-
retries += 1;
88+
sendFailureLog.Error(ex, "Failed to ship a batch");
9389
}
90+
91+
var millisecondsDelay = (int)Math.Min(Math.Pow(2, retries) * 2000, 60000);
92+
sendFailureLog.Information("Backing off connection schedule; will retry in {MillisecondsDelay}", millisecondsDelay);
93+
await Task.Delay(millisecondsDelay, cancellationToken);
94+
retries += 1;
9495
}
9596
}
9697

0 commit comments

Comments
 (0)