agent: keep backing off on lines that stay down

The control layer keeps doubling after the first minute up to ten minutes, and the QUIC redial doubles after twelve short attempts up to five minutes, instead of retrying every minute or every five seconds forever.
This commit is contained in:
justme committed 2026-10-22 05:28:29 +08:00
1 parent e0376b5e33
commit 4c31a4a79e
4 files changed
+24 -3

No files matched your search

@@ -4,7 +4,7 @@ namespace MoShiro.Agent.Tests;
public sealed class ControlBackoffTests
{
[Fact]
public void Next_UsesRequestedEscalationThenCapsAtOneMinute()
public void Next_UsesRequestedEscalationThenKeepsDoublingToTenMinutes()
{
var backoff = new ControlBackoff();
TimeSpan[] expected =
@@ -13,7 +13,8 @@ public sealed class ControlBackoffTests
TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(16),
TimeSpan.FromSeconds(32), TimeSpan.FromSeconds(32), TimeSpan.FromSeconds(32),
TimeSpan.FromSeconds(32), TimeSpan.FromSeconds(32),
TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1),
TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(2), TimeSpan.FromMinutes(4),
TimeSpan.FromMinutes(8), TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(10),
];
Assert.Equal(expected, expected.Select(_ => backoff.Next()));