Skip to content

fix(stack): keep Auth database and stack host connections alive - #7080

Open
jgoux wants to merge 3 commits into
developfrom
juliengoux/cli-2622-expose-the-auth-db-connection-pool-in-configtoml-local-auth
Open

jgoux wants to merge 3 commits into
developfrom
juliengoux/cli-2622-expose-the-auth-db-connection-pool-in-configtoml-local-auth

Conversation

@jgoux

@jgoux jgoux commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

TL;DR

stops local Auth and the stack host from opening a new connection for every request.

whats broken?

Auth keeps no idle Postgres connections unless an idle pool size is set, so every Auth request opened and closed its own database connection and left it in TIME_WAIT. A busy test suite could use up the macOS port range, the same way gateway writes did before #7075.

The stack host's HTTP client (readiness probes every 250 ms, log forwarding to Analytics) also used a non-keep-alive agent, so each call opened a new connection.

now fixed by:

  • local Auth runs with a pool of 10 connections that stay open when idle, in both the stack and supabase start. No new config.toml keys.
  • the stack host's HTTP client reuses connections and closes them after 4 s idle, before the shortest upstream keep-alive of 5 s.

ref:

@jgoux
jgoux requested a review from a team as a code owner October 9, 2026 15:15
@jgoux jgoux self-assigned this Oct 9, 2026
…expose-the-auth-db-connection-pool-in-configtoml-local-auth

# Conflicts:
#	packages/stack/src/services/AuthStorage.integration.test.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the Auth DB connection pool in config.toml (local Auth keeps no idle connections)

1 participant