• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 36776987673
67%
develop: 67%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/develop/pr-7031-96f9720fef4abce549fc7dbc9f606c04a31711e9
DEFAULT BRANCH: develop
Ran 30 Sep 2026 09:06PM UTC
Jobs 1
Files 79
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Sep 2026 09:03PM UTC coverage: 66.737%. Remained the same
36776987673

push

github

web-flow
fix(stack): reuse keep-alive upstream connections in the HTTP gateway (#6925)

## TL;DR

The local stack's API gateway no longer opens a new upstream connection
for every request. Safe, bodyless requests (GET, HEAD, OPTIONS, TRACE)
reuse pooled keep-alive connections, so sustained read traffic stops
producing waves of `502 Bad Gateway`. Writes keep one connection per
request so they are never sent twice.

## Before

```mermaid
flowchart LR
  C[Client request] --> G[Gateway]
  G --> N["New upstream connection<br/>(every request)"]
  N --> U[Upstream]
  U --> X[Connection closed]
  X --> T["TIME_WAIT piles up"]
  T --> F["502 waves:<br/>EADDRNOTAVAIL native,<br/>forwarder resets on Docker"]
```

## After

```mermaid
flowchart LR
  C[Client request] --> R{"Safe method<br/>and no body?"}
  R -- yes --> P["Pooled keep-alive<br/>connection"]
  R -- no --> F["Fresh connection,<br/>never replayed"]
  P --> E{"Failed before<br/>a response?"}
  E -- yes --> O["One retry on a<br/>fresh connection"]
  E -- no --> D[Response]
```

## Why

Since #6897 the gateway forwarded with `agent: false`. Under sustained
concurrent `GET /rest/v1/` traffic, closed connections pile up in
`TIME_WAIT`: the native runtime fails with `connect EADDRNOTAVAIL` once
the ephemeral range is full, and on Docker Desktop the port forwarder
starts resetting connections (`socket hang up`, `ECONNRESET`). The
gateway then answers 502 until `TIME_WAIT` drains. Details and
measurements are in #6922.

#6897 moved away from pooling because Studio's MCP route closes its
connection shortly after each POST, so a pooled POST could land on a
closing connection and could not be replayed. Those POSTs now stay on
fresh connections.

## What changed

- One keep-alive agent per gateway, released with it; sockets per
upstream stay unbounded so long-lived streamed responses never queue
other requests, and idle sockets close after 4 s, before Node upstreams'
keep-alive timeout.
- Only safe, bodyless requests use... (continued)

4097 of 6139 relevant lines covered (66.74%)

7.37 hits per line

Jobs
ID Job ID Ran Files Coverage
1 36776987673.1 30 Sep 2026 09:06PM UTC 79
66.74
GitHub Action Run
Source Files on build 36776987673
  • Tree
  • List 79
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36776987673
  • 985e0ae9 on github
  • Prev Build on develop (#36761952394)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc