mirror of
https://github.com/versity/versitygw.git
synced 2026-09-22 16:04:15 +00:00
The native side releases its session quota when it fires the teardown notification, before the audit record lands in a sink, so session turnover can queue more unpublished records than the live-session limit allows. Hold an admission credit per session from registration until its record is published, and refuse new sessions while the backlog of unpublished session records reaches the native session quota: the refusal rolls the prepare back, still publishes the request-level audit record, and answers SlowDown so the client retries. A stalled sink now turns into latency instead of unbounded memory. Count dropped request records under the publication mutex so the shutdown drop-count report cannot miss an increment racing it.