fix(site-runtime): NativeAlarmActor retries a lost subscribe response, not only a failed one (S4)

This commit is contained in:
Joseph Doherty
2026-07-09 00:05:09 -04:00
parent feb6f34e90
commit fa556b4f8d
2 changed files with 25 additions and 0 deletions
@@ -129,6 +129,15 @@ public class NativeAlarmActor : ReceiveActor
SourceReference: _source.SourceReference,
ConditionFilter: _source.ConditionFilter,
Timestamp: DateTimeOffset.UtcNow));
// Arm a response-timeout retry so a LOST subscribe response is re-sent, not
// only a failure reply (S4). Cancelled on a Success reply; a failure reply
// re-arms it at 1× (overriding this 2× response-timeout arm). 2× interval so
// a slow-but-arriving response is not pre-empted by a redundant re-send.
_retryTimer?.Cancel();
_retryTimer = Context.System.Scheduler.ScheduleTellOnceCancelable(
TimeSpan.FromMilliseconds(_options.NativeAlarmRetryIntervalMs * 2),
Self, RetrySubscribe.Instance, Self);
}
private void HandleRehydration(RehydrationCompleted msg)
@@ -270,6 +279,8 @@ public class NativeAlarmActor : ReceiveActor
{
if (resp.Success)
{
// Success — cancel the response-timeout retry armed in SendSubscribe.
_retryTimer?.Cancel();
_logger.LogInformation("Native alarm subscription established for {Source} on {Instance}",
_source.CanonicalName, _instanceName);
return;