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: debounce snapshot persistence and encode outside the client lock #77
With offline storage configured, the Python SDK persists its flag cache by re-encoding the whole cache while holding the client lock, then fsyncing. Deltas processed in one task are already coalesced (_persist_pending). Even so, a burst of updates costs a full encode and fsync per batch, and evaluations wait on the lock while the encode runs. This is a performance issue, not a security one. It was rated low and accepted for 0.2.0.
Acceptance criteria
Persistence is debounced (documented interval, e.g. 250 ms to 1 s) and encodes a snapshot taken under the lock, not while holding it.
Test: 1,000 deltas applied within 1 s produce at most 1 + duration ÷ interval writes.
While persisting a 10,000-flag cache, lock hold time per evaluation stays at or below 1 ms at p99 (measured in a test or benchmark).
Crash safety is retained: writes stay atomic (temp file + rename). The last write after a burst is not lost when close() is called (flush on close).
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; lock hold time p99 at or below 0.41 ms during snapshot writes; atomic writes and flush on
close()tested.Details are in the 0.2.1 changelog.