EventStream: event-queue overflow and subscriber-limit both surface as ResourceExhausted #216

Closed
opened 2026-11-09 12:33:49 -05:00 by dohertj2 · 1 comment
Owner

EventStreamService maps a worker EventQueueOverflow to gRPC ResourceExhausted — the same status used for the subscriber/session-limit rejections. A client therefore cannot tell "you fell behind and events were lost" (re-subscribe + resync) from "limit reached" (back off / don't retry). Found while documenting backpressure for #204.

Either split the code (e.g. DataLoss or Aborted for overflow) or keep ResourceExhausted and attach a distinguishing detail/trailer, then document it in docs/ClientBehaviorFixtures.md. A status change is a client-visible contract change — check the five clients' handling first.

`EventStreamService` maps a worker `EventQueueOverflow` to gRPC `ResourceExhausted` — the same status used for the subscriber/session-limit rejections. A client therefore cannot tell "you fell behind and events were lost" (re-subscribe + resync) from "limit reached" (back off / don't retry). Found while documenting backpressure for #204. Either split the code (e.g. `DataLoss` or `Aborted` for overflow) or keep `ResourceExhausted` and attach a distinguishing detail/trailer, then document it in docs/ClientBehaviorFixtures.md. A status change is a client-visible contract change — check the five clients' handling first.
dohertj2 added the area:gatewaytype:review-findingpriority:p3 labels 2026-11-09 12:33:49 -05:00
Author
Owner

Fixed on main fccc21ba (non-breaking): status stays ResourceExhausted, now with an mxgw-reason response trailer — event-queue-overflow, alarm-feed-overflow, subscriber-limit, subscriber-already-active, session-limit, command-too-large (constants in Contracts/ResourceExhaustedReasons.cs; the API-key failure throttle has none). .NET client: new MxGatewayResourceExhaustedException : MxGatewayException (existing catches still work) with Reason / IsOverflow / IsSubscriberLimit (Reason null from an older gateway). docs/ClientBehaviorFixtures.md 'ResourceExhausted Reason Trailer' section incl. Go/Java/Python/Rust notes (no code change there). 4 server + 3 client tests fail with the change stashed. Evidence: NonWindows.slnx 0 warnings/0 errors; .NET client solution builds clean; MxGateway.Tests 1413 passed / 2 skipped; .NET client tests 153 passed / 1 skipped (live).

Fixed on main fccc21ba (non-breaking): status stays ResourceExhausted, now with an `mxgw-reason` response trailer — event-queue-overflow, alarm-feed-overflow, subscriber-limit, subscriber-already-active, session-limit, command-too-large (constants in Contracts/ResourceExhaustedReasons.cs; the API-key failure throttle has none). .NET client: new MxGatewayResourceExhaustedException : MxGatewayException (existing catches still work) with Reason / IsOverflow / IsSubscriberLimit (Reason null from an older gateway). docs/ClientBehaviorFixtures.md 'ResourceExhausted Reason Trailer' section incl. Go/Java/Python/Rust notes (no code change there). 4 server + 3 client tests fail with the change stashed. Evidence: NonWindows.slnx 0 warnings/0 errors; .NET client solution builds clean; MxGateway.Tests 1413 passed / 2 skipped; .NET client tests 153 passed / 1 skipped (live).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/mxaccessgw#216