stack: gateway still opens a new upstream connection per request on 2.119.0 (exhausts ephemeral ports on macOS)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- postgresql, typescript
- Ambito
- backend-api-design, networking
Direzione di ricerca
Start by locating the native-runtime HTTP gateway's upstream request handling and tracing how it connects to PostgREST and Auth. Reproduce the reported Playwright contract-suite load against one local stack and inspect connection reuse and TIME_WAIT counts. Done means proxied requests reuse upstream connections and the run no longer exhausts ephemeral ports or produces the reported transient failures.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On CLI 2.119.0 (which contains #6925, the fix for #6922), the native-runtime HTTP gateway still opens a new upstream TCP connection per proxied request to PostgREST and Auth. Under a test suite's load this exhausts macOS's ephemeral port range within a single run. Requests then fail with Bad Gateway, fetch failed, and Auth's failed to connect … connect: can't assign requested address.
Environment
- Supabase CLI 2.119.0 (Homebrew),
[experimental] stack = true, native runtime - macOS 26.6.2, Apple silicon. Ephemeral range 49152–65535,
net.inet.tcp.msl=15000. - Slim services from the stack cache: PostgREST
v16.4-r0, Authv2.197.0-r0(darwin-arm64)
Reproduction
A Playwright contract suite of about 1,160 tests (2 workers, supabase-js clients, mostly RPC calls and auth.admin.createUser) run against one local stack. It takes about 40s.
Evidence
TIME_WAIT sockets, sampled every 2s through a single run that started from a drained machine (6 sockets): peak 16,309, effectively the entire ephemeral range.
Grouped by destination port, about 25s into a run:
| Destination | Listener | TIME_WAIT |
|---|---|---|
| 64008 | postgrest/v16.4-r0/.../.postgrest-wrapped |
8,547 |
| 24782 | stack Postgres (database.sql) |
4,180 |
| 63992 | auth/v2.197.0-r0/.../.auth-wrapped |
693 |
| 23647 | the public gateway (client side) | 433 |
So the client-to-gateway hop reuses connections (433), while the gateway-to-PostgREST and gateway-to-Auth hops do not. The Postgres churn looks like #6981 (Auth keeps no idle connections).
Auth's log at the failure:
"error":"Unhandled server error: couldn't start a new transaction: could not create new transaction:
failed to connect to `host=127.0.0.1 user=supabase_auth_admin database=postgres`:
dial error (dial tcp 127.0.0.1:24782: connect: can't assign requested address)"
Test-visible errors: Bad Gateway on REST and Storage, fetch failed, Database error querying schema / Database error checking email from Auth. All are transient and clear once TIME_WAIT drains.
Workaround
sudo sysctl -w net.inet.tcp.msl=1000 (frees a closed port in 2s instead of 30s).
Related
#6922 (closed by #6925), #6975, #6981
- Lingua principale
- TypeScript
- Stelle
- 2.4k
- Fork
- 531
- Merge medio
- 1g 2h
- PR unite (30g)
- 303
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di supabase/cli
-
🐛 Bug supabase/cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
supabase/cli#6976 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
stack: the HTTP gateway closes idle keep-alive connections after 5 s, so a client whose event loop is blocked gets ECONNRESET (`fetch failed`) on its next requestForse già presa @7ttp l’ha presa 2 giorni fa. Aperta🐛 Bug supabase/cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
supabase/cli#6975 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
📘 Docs supabase/cli
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Migration error caret is missing or misplaced when the statement contains multibyte charactersAperta🐛 Bug supabase/cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
🐛 Bug supabase/cli
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di supabase/cli
Issue simili
-
perf(core): getComments() runs the approved count and the comment list as two sequential queriesApertaarea/core bot:bug bot:working
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
emdash-cms/emdash#3905 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
lingdojo/kana-dojo#31728 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
selective-claw: freshTailTurns=0 keeps ALL turns verbatim and summarizes none (slice(-0) === slice(0))Forse già presa @zjncs l’ha presa oggi. Apertacomponent:tokenless
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
agentic-os-org/ANOLISA#6112 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rjsf-team/react-jsonschema-form#5439 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno