fix: harden concurrency limits and high-RPM runtime paths

Bound request, stream, queue, and shutdown resource lifetimes. Reduce scheduler and Redis hot-path work and isolate database maintenance. Include regression coverage, load probes, and concurrency audit results.
This commit is contained in:
elky
2026-09-10 08:14:58 +08:00
parent 361952ada9
commit ecc16673eb
149 changed files with 27963 additions and 1926 deletions
@@ -93,7 +93,7 @@ pub async fn run_migrations_with_bootstrap(
pool: &PgPool,
bootstrap: &dyn PostgresMigrationBootstrap,
) -> Result<(), MigrateError> {
let mut conn = pool.acquire().await?;
let mut conn = crate::pool::acquire_postgres_migration_connection(pool).await?;
if POSTGRES_MIGRATOR.locking {
conn.lock().await?;
@@ -132,7 +132,7 @@ pub async fn prepare_database_for_startup_with_bootstrap(
pool: &PgPool,
bootstrap: &dyn PostgresMigrationBootstrap,
) -> Result<Vec<PendingMigrationInfo>, MigrateError> {
let mut conn = pool.acquire().await?;
let mut conn = crate::pool::acquire_postgres_migration_connection(pool).await?;
if POSTGRES_MIGRATOR.locking {
conn.lock().await?;