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
Commit f45a2f8
Browse filesBrowse the repository at this point in the historyBrowse files
fix(server): scope the SSH identity lock per sandbox and bound data-pool lock holders (#4696)
* fix(server): bound data-pool lock holders
The SSH identity and provider-refresh locks each hold their PostgreSQL
advisory lock on a data-pool connection, and their holders then query
the same pool. At a small database_max_connections, a few holders could
take every data connection and wait for one more until sqlx's 30-second
acquire timeout, stalling every database request on the replica.
Each PostgresStore now has max(1, max_connections / 2) data-pool lock
slots. A holder takes a slot before its connection and keeps it until
that connection has closed, so every holder can still get a second
connection for its queries. A slot that stays busy for the 10-second
mutation lock timeout fails with a lock timeout and a warning. The
floor rationale in the config docs, man page and startup error now names
both holders, and mutation_lock.rs documents the slot-sharing cycle the
timeouts break at small pools.
Part of #4307.
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* fix(server): scope the SSH identity lock per sandbox
SSH host identity provisioning and cleanup took one fleet-wide advisory
key and a process-wide mutex, so create, start, restart and delete ran
that step for one sandbox at a time across the fleet, with each waiting
create holding a lock-pool connection.
The SSH identity guard now takes the legacy key in shared mode and then
an exclusive key derived from the sandbox id, on one data-pool
connection and one data-pool lock slot. The local mutex is keyed by
sandbox id too. Steps for different sandboxes run at once, steps for the
same sandbox still exclude each other on every replica, and gateways
from earlier releases, which hold the legacy key exclusively, keep
excluding new ones during a rolling upgrade.
One 10-second deadline now covers a data-pool lock holder's slot, its
connection and every lock statement, as it already did for mutation
locks, so the second lock statement doesn't extend the wait under
create's mutation guard. A lock that times out returns a lock timeout.
Part of #4307.
Closes#4686
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* fix(server): release the create guard before the SSH identity step
Sandbox creation held its PostgreSQL mutation guard while it waited for the
SSH identity keys, so each replica admitted at most one in-flight create per
lock-pool connection. The per-sandbox SSH identity lock already fences a
concurrent delete, so release the guard before that step.
Data-pool lock connections were closed on every release, which opened a new
PostgreSQL session per create. Unlock and reset an idle session and return it
to the pool; close it only when a lock statement may still be waiting.
Signed-off-by: divesh <dgude@nvidia.com>
---------
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
Signed-off-by: divesh <dgude@nvidia.com>
Co-authored-by: divesh <dgude@nvidia.com>
0 commit comments