07badd139e3aa95e5b0c8d8d5adac9d977b3d138
The replay ring was bounded only by ReplayBufferCapacity (1024 events) and ReplayRetentionSeconds. Event size is unbounded up to the worker frame size, so a burst of large-array events could pin gigabytes per session while the count looked small. New MxGateway:Events:ReplayBufferMaxBytes (default 64 MiB, 0 disables) caps the summed serialized size (MxEvent.CalculateSize, measured only when the cap is on). Over the cap the oldest entries are evicted, exactly like the count cap, so a resuming subscriber sees the existing ReplayGap path; an event bigger than the whole cap is not retained. Every eviction (count, age or byte) now clears its slot, so an evicted event is released immediately instead of staying referenced until the slot is reused. The 64 MiB default is a judgement call: it never binds for scalar traffic (1024 x a few hundred bytes) and only trims large-array bursts. Tests: SessionEventDistributorTests byte-cap eviction, single oversized event, cap 0 = count only (the first two fail with the cap enforcement removed); validator rejects a negative value. Docs: GatewayConfiguration.md, Sessions.md, DesignDecisions.md; appsettings.json carries the key. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
Description
No description provided
Languages
C#
50.8%
Java
37.1%
Python
3%
Rust
2.9%
Go
2.5%
Other
3.6%