20392cf246
Interlocking changes across the gateway server (shared GatewaySession.cs / SessionManager.cs), committed together: - GWC-01 (Critical): alarm monitor now attaches as an internal (non-counted) distributor subscriber instead of a second raw drain of the single worker event channel; WorkerClient._events -> SingleReader with a claimed-once guard so a future dual-consumer regression throws loudly. - GWC-02 (High): faulted sessions are swept in CloseExpiredLeasesAsync (IsFaultedReapable + FaultedReason); new FaultedGraceSeconds (default 0). - GWC-03 (High): configurable MaxSparseArrayLength (default 1_000_000) enforced before allocation. - TST-02 (High, security): StreamEvents attach now enforces the opening key id -> PermissionDenied on owner mismatch. - TST-12 (Medium): CLAUDE.md retention-defaults sentence corrected. Verified: NonWindows build clean; targeted tests 135/135 on macOS, plus WorkerClientTests 18/18 on the Windows host.
21 lines
583 B
C#
21 lines
583 B
C#
namespace ZB.MOM.WW.MxGateway.Server.Sessions;
|
|
|
|
public enum SessionManagerErrorCode
|
|
{
|
|
SessionNotFound,
|
|
SessionNotReady,
|
|
EventSubscriberAlreadyActive,
|
|
EventSubscriberLimitReached,
|
|
EventQueueOverflow,
|
|
SessionLimitExceeded,
|
|
OpenFailed,
|
|
CloseFailed,
|
|
|
|
/// <summary>
|
|
/// The caller is not permitted to perform the operation on this session — for example,
|
|
/// attaching a <c>StreamEvents</c> stream to a session opened by a different API key.
|
|
/// Maps to gRPC <c>PermissionDenied</c>.
|
|
/// </summary>
|
|
PermissionDenied,
|
|
}
|