fix(site-runtime): NativeAlarmActor retries a lost subscribe response, not only a failed one (S4)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user