stack: gateway still opens a new upstream connection per request on 2.119.0 (exhausts ephemeral ports on macOS)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- postgresql, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 2.4k
- フォーク
- 531
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 332
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
supabase/cli のほかの issue
-
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 request対応中かも @7ttp が 3 日前に担当しました。 オープン🐛 Bug supabase/cli
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
📘 Docs supabase/cli
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 3/5 半日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
stack: functions serve fails with "Dependent … blocks restart of …" after a plain supabase startオープン🐛 Bug supabase/cli
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
umbraco/Umbraco-CMS-MCP-Dev#512 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wimpysworld/sidra#290 ·
メンテナーはふだん 1 日以内に返信
-
defuFn invokes function values for inherited default properties対応中かも @xiehuanyi が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
feature request good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
TabularisDB/tabularis#853 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 85/100
capricorn86/happy-dom#2474 ·
メンテナーはふだん 2 日以内に返信