fix(gateway): batch SSH session cleanup writes - #3000
Conversation
Part of #2999. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Issue fixture verificationVerified commit
Full evidence: #2999 (comment) |
|
Full code review completed.
Ready for maintainer review. |
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
elezar
left a comment
There was a problem hiding this comment.
The SSH session reaper used offset pagination, so an independent deletion from an earlier page could shift a later expired session behind the next offset and leave it persisted. This update adds an unignored deterministic regression test: it seeds 1,001 expired sessions, removes an early-page row between reads, and asserts that the reaper leaves no expired session behind. The follow-up keyset pagination change makes that test pass.
Summary
Batch SSH-session persistence cleanup into bounded set-based deletes so sandbox teardown and the session reaper do not issue one database write per session. This addresses the gateway-side contention risk reported in #2999 without changing SQLite journal settings, timeouts, or session ownership schema.
Related Issue
Part of #2999.
This is PR 1 of 2. The issue does not currently carry an accepted-state label; the direct implementation and ready-for-review request authorized this submission, while maintainers retain the acceptance and merge decision.
Changes
delete_manystore operation with fixed 128-ID chunks for SQLite and PostgresTesting
mise run pre-commitmise run test(review rerun: 1,443 server tests passed)main, then passed on this PR and the combined branchesmise run e2e:dockermise run cipasses locally — all Rust, Python, TypeScript, lint, compile, and policy checks passed; three unrelated Go gateway fixture tests fail because this workstation's hard-coded/etc/openshell/gateways/defaultis included as an unexpected system fixtureReview
A full line-by-line review covered both persistence backends, chunk bounds, empty/duplicate/missing IDs, object-type isolation, pagination before mutation, partial-chunk idempotency, cleanup/reaper telemetry, secret-safe logging, tests, and architecture documentation. No actionable findings remained.
Checklist