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

supabase / supavisor / 29034153596
77%

Build:
DEFAULT BRANCH: main
Ran 09 Jul 2026 04:45PM UTC
Jobs 2
Files 130
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

09 Jul 2026 04:38PM UTC coverage: 77.22% (-0.1%) from 77.358%
29034153596

push

github

web-flow
fix: handle client socket errors on DbHandler, sweep zombie ports, hold check-in till flush complete (#1060)

When the timeout closes ({send_timeout_close, true} (a ranch default))
are triggered in the inet backend, the underlying TCP socket is closed,
but there's no notification to the owner process, and the port stays
alive.

We must then make sure that when we get the timeout error from send, we
adequately react and the relevant processes are terminated. The
DbHandler didn't check the return value when writing to the client, and
when timing out would cause zombie ports+client handlers, which could
even hold a database session, and potentially create long transactions.
I reproduced this scenario in a test.

This doesn't apply to the upstream sockets to database, which don't use
this option.

The dead port sweeper is cherry picked from
https://github.com/supabase/supavisor/pull/1056, which was the bug
mitigation targeted at the current v2.9 release.

Also addresses a related race condition that could cause a DbHandler
that is busy flushing data to a slow client to be checked out by another
client if (and only if) the query had already completed from the
DbHandler perspective. This was fixed by making the DbHandler checkin
itself when its work is complete, instead of relying on the
ClientHandler to check it in.I don't expect this to make much of a
difference in real life, but its a more correct behaviour.

33 of 41 new or added lines in 4 files covered. (80.49%)

4 existing lines in 4 files now uncovered.

2644 of 3424 relevant lines covered (77.22%)

54383.87 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
66.67
lib/supavisor/dead_port_sweeper.ex
3
84.62
0.1% lib/supavisor/db_handler.ex

Coverage Regressions

Lines Coverage ∆ File
1
88.54
-1.04% lib/supavisor/monitoring/prom_ex.ex
1
86.84
-2.63% lib/supavisor/monitoring/tenant.ex
1
76.92
-7.69% lib/supavisor/erl_sys_mon.ex
1
93.85
-1.54% lib/supavisor/circuit_breaker/sliding_window.ex
Jobs
ID Job ID Ran Files Coverage
1 run-integration - 29034153596.1 09 Jul 2026 04:45PM UTC 130
42.0
GitHub Action Run
2 run-tests - 29034153596.2 09 Jul 2026 04:46PM UTC 130
75.76
GitHub Action Run
Source Files on build 29034153596
  • Tree
  • List 130
  • Changed 9
  • Source Changed 4
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29034153596
  • d7079a88 on github
  • Prev Build on main (#29025927663)
  • Next Build on main (#29055230766)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc