Skip to content

fix(dashboard): SSE stall eviction is elapsed-time based; one idempotent teardown for every exit path (Sage review of #664) - #665

Merged
HenryLach merged 2 commits into
mainfrom
fix/dashboard-sse-teardown
Sep 18, 2026
Merged

HenryLach merged 2 commits into
mainfrom
fix/dashboard-sse-teardown

Conversation

@HenryLach

Copy link
Copy Markdown
Owner
  • Eviction after SSE_MAX_STALLED_MS (30 s) of continuous backpressure
    measured on a monotonic clock, not 15 ticks: fs.watch debounce bursts
    during a busy batch could otherwise burn the tick budget in ~3 s and drop
    a briefly-backpressured healthy client.
  • teardownSseClient(clients, client): unregister + clear the ping timer
    (now owned by the client record) + destroy, idempotent. Used by stall
    eviction, synchronous write failure (previously deleted without
    destroy/clearInterval, leaving the ping timer retaining the response),
    ping write failure, socket timeout, and req/res close/error.
    Tests: bursty-broadcast no-evict, boundary, recovery, throw → full teardown
    with timer cleared, idempotent teardown, 39-hour scenario. 4143 pass.

…ent teardown for every exit path (Sage review of #664)

- Eviction after SSE_MAX_STALLED_MS (30 s) of continuous backpressure
  measured on a monotonic clock, not 15 ticks: fs.watch debounce bursts
  during a busy batch could otherwise burn the tick budget in ~3 s and drop
  a briefly-backpressured healthy client.
- teardownSseClient(clients, client): unregister + clear the ping timer
  (now owned by the client record) + destroy, idempotent. Used by stall
  eviction, synchronous write failure (previously deleted without
  destroy/clearInterval, leaving the ping timer retaining the response),
  ping write failure, socket timeout, and req/res close/error.
Tests: bursty-broadcast no-evict, boundary, recovery, throw → full teardown
with timer cleared, idempotent teardown, 39-hour scenario. 4143 pass.
@HenryLach
HenryLach merged commit dfa342b into main Sep 18, 2026
1 check passed
@HenryLach
HenryLach deleted the fix/dashboard-sse-teardown branch September 18, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant