fix(#654): review fixes - non-vacuous stop-on-publish test, Error only when retry budget refuses

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-08 23:39:06 -04:00
parent 9dc6390d50
commit 2659a690a6
3 changed files with 30 additions and 17 deletions
@@ -282,12 +282,14 @@ public sealed class CentralCommunicationActor : ReceiveActor, IWithTimers
}
/// <summary>Re-arms a single-shot <see cref="RefreshContacts"/> while the gate is unpublished.</summary>
private void ScheduleBootstrapRetry()
/// <returns><see langword="false"/> when the retry budget is spent and nothing was scheduled.</returns>
private bool ScheduleBootstrapRetry()
{
if (_bootstrapRetries >= MaxBootstrapRetries)
return;
return false;
_bootstrapRetries++;
Timers.StartSingleTimer(BootstrapRetryTimerKey, new RefreshContacts(), _bootstrapRetryInterval);
return true;
}
/// <summary>
@@ -758,12 +760,11 @@ public sealed class CentralCommunicationActor : ReceiveActor, IWithTimers
// Gated on a factory having been supplied at all: a never-supplied factory is a
// deliberate wiring/test choice Resolve() already stayed silent about (see its
// remarks), not a resolve failure, so it earns no Error here either.
if (_pskProviderFactory is not null && !_gatePublished)
ScheduleBootstrapRetry();
// Error only once the bounded fast retry is exhausted, so a healed boot race stays quiet.
if (_pskProviderFactory is not null && !_pskProviderAbsenceReported
&& _bootstrapRetries >= MaxBootstrapRetries)
// Error only when the scheduler REFUSES (budget spent and this final attempt also
// failed), so a healed boot race stays quiet.
var budgetSpent = _pskProviderFactory is not null && !_gatePublished
&& !ScheduleBootstrapRetry();
if (budgetSpent && !_pskProviderAbsenceReported)
{
_pskProviderAbsenceReported = true;
_log.Error(