You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python: bound the SSE event queue (backpressure) #74
The Python SDK's event loop hands parsed stream events to the client through an unbounded queue (sdks/python/python/checkgate/_loop.py). Line and event sizes are bounded (16 MiB), but the number of queued events is not. If events arrive faster than the client applies them, memory use can grow without a limit. Reaching that state needs a misbehaving server or network path. This was found in the 0.2.0 review, rated low, and accepted for 0.2.0.
Acceptance criteria
A per-stream in-flight budget (bytes and/or events) with a documented default; it is configurable on CheckgateClient.
When the budget is exceeded, the client drops the stream and reconnects, resuming from its last applied revision. No delta is applied out of order, and get_health() reports the event.
Test: a stub server that streams large events faster than a deliberately slow consumer keeps the client's queued bytes at or below the budget. Peak RSS growth stays within the budget plus 32 MiB.
The shared fault-injection suite (sdks/conformance) and sdks/python/tests pass unchanged.
Fixed in 0.2.1 by #96 (merged to dev; part of the 0.2.1 release).
Verification: Python SDK tests in CI (3.11, 3.13) and the shared SSE fault-injection suite; a stream flood test kept client RSS under 48 MiB with the default max_stream_backlog_bytes.
Activity
Merge pull request #96 from checkgate-sh/fix/v0.2.1-python-sdk
akosidencio commentedon Nov 30, 2026
Fixed in 0.2.1 by #96 (merged to
dev; part of the 0.2.1 release).Verification: Python SDK tests in CI (3.11, 3.13) and the shared SSE fault-injection suite; a stream flood test kept client RSS under 48 MiB with the default
max_stream_backlog_bytes.Details are in the 0.2.1 changelog.