DashboardSnapshotPublisher hot-spins: no reconnect delay when the snapshot watch completes cleanly #222

Closed
opened 2026-11-09 13:10:08 -05:00 by dohertj2 · 1 comment
Owner

DashboardSnapshotPublisher reconnects after ReconnectDelay only on the exception path. When WatchSnapshotsAsync completes cleanly it re-subscribes immediately, so a snapshot source that completes at once makes the publisher hot-spin (demonstrated by the test fake CompleteImmediatelySnapshotService; the test was renamed ..._Resubscribes in #205 because it never tested a delay). The class doc says it reconnects after the delay. Apply the delay on clean completion too (fake-time test now possible via the #205 TimeProvider seam).

`DashboardSnapshotPublisher` reconnects after `ReconnectDelay` only on the exception path. When `WatchSnapshotsAsync` completes cleanly it re-subscribes immediately, so a snapshot source that completes at once makes the publisher hot-spin (demonstrated by the test fake `CompleteImmediatelySnapshotService`; the test was renamed `..._Resubscribes` in #205 because it never tested a delay). The class doc says it reconnects after the delay. Apply the delay on clean completion too (fake-time test now possible via the #205 TimeProvider seam).
dohertj2 added the area:dashboardtype:bugpriority:p3 labels 2026-11-09 13:10:08 -05:00
Author
Owner

Fixed on main bc28e143: DashboardSnapshotPublisher waits the reconnect delay after a clean completion of the snapshot watch, as the fault path already did. Test ExecuteAsync_WhenSnapshotServiceCompletes_ResubscribesOnlyAfterReconnectDelay (fake clock): no resubscribe at delay−1 ms, one at the delay; fails with the fix stashed (reconnect timer never armed in the hot-spin code). Evidence: NonWindows.slnx 0 warnings/0 errors; MxGateway.Tests 1395 passed / 2 skipped.

Fixed on main bc28e143: DashboardSnapshotPublisher waits the reconnect delay after a clean completion of the snapshot watch, as the fault path already did. Test ExecuteAsync_WhenSnapshotServiceCompletes_ResubscribesOnlyAfterReconnectDelay (fake clock): no resubscribe at delay−1 ms, one at the delay; fails with the fix stashed (reconnect timer never armed in the hot-spin code). Evidence: NonWindows.slnx 0 warnings/0 errors; MxGateway.Tests 1395 passed / 2 skipped.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/mxaccessgw#222