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

supabase / supavisor / 37803781336
81%

Build:
DEFAULT BRANCH: main
Ran 08 Oct 2026 03:57PM UTC
Jobs 2
Files 146
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

08 Oct 2026 03:48PM UTC coverage: 81.32% (+0.1%) from 81.179%
37803781336

push

github

web-flow
Clear the secrets for validation on a pool shutdown (#1208)

Invalidate client authentication globally on a pool shutdown

It only invalidates the `:secrets_for_validation` if there's no sibling
pool for the same tenant and DB user; i.e. the cache is NOT cleared if
there's another pool for the same tenant and DB user but different
mode/db/upstream_tls/search_path settings.

The PR also adds a missing logs.

Caveats:
* on each pool shutdown RCP multicall is made once or twice: to retrieve
pools' PIDs and then optionally to invalidate the cache globally

EDIT 1:

New approach has been proposed: instead of checking and invalidating
globally via `:erpc`, we take advantage of the `:syn`'s `:tenants`
process group to which we join every pool keyed by `{tenant, user}`.
When a pool shuts down, we check the group for members — if there're
some we keep the cache, otherwise, we invalidate. The invalidation is
run locally.

The process still involves inter-cluster comms on the shutdown as we
check the remote pools liveness via `erpc` but the impact is way lower
as we already have a list of pools and we don't have to check each node.

The downside of invalidating locally is that it might fail (e.g. due to
the erpc-base liveness check) at one node while succeed on the other.
But we'd be facing the same risk with the previous approach.

EDIT 2:

We slightly changed the approach by using a separate `tenant_pools`
scope as the `Supavisor.Terminator` unregisters a pool being drained and
shutdown early from the `:tenants` scpoe to allow for the pool to be
created on another node.



EDIT 3 (race-freedom of the last-member check):

We dropped the `:erpc` liveness check. It isn't needed, and it broke the
node-down case.

`:syn` calls `on_process_left/5` serially in each node's scope process,
after removing the leaving pid from the group, and every node gets a
callback for every leaving pool. `invalidate_local/2` only clears that
node's cache, so each node decides on its o... (continued)

29 of 30 new or added lines in 3 files covered. (96.67%)

4 existing lines in 4 files now uncovered.

3191 of 3924 relevant lines covered (81.32%)

48564.55 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
91.03
-0.64% lib/supavisor/client_authentication.ex

Coverage Regressions

Lines Coverage ∆ File
1
95.38
0.0% lib/supavisor/circuit_breaker/sliding_window.ex
1
91.67
-8.33% lib/supavisor/terminator.ex
1
87.5
-4.17% lib/supavisor/client_handler/proxy/supervisor.ex
1
92.86
-7.14% lib/supavisor/client_handler/proxy.ex
Jobs
ID Job ID Ran Files Coverage
1 run-tests - 37803781336.1 08 Oct 2026 04:05PM UTC 146
80.56
GitHub Action Run
2 run-integration - 37803781336.2 08 Oct 2026 03:57PM UTC 146
42.0
GitHub Action Run
Source Files on build 37803781336
  • Tree
  • List 146
  • Changed 15
  • Source Changed 4
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #37803781336
  • 5df5caf1 on github
  • Prev Build on main (#37630327040)
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