You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3624bb3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): skip docker's first health check wait (CLI-2901) (#7430)
## TL;DR
fixes `supabase start` sitting about 10s on docker's first health check
when the services are already up.
## whats improved/fixed?
docker runs a container's first health check one full interval after it
starts, and our interval is 10s.
so `supabase start` kept waiting on that check even when everything was
ready sooner.
a restart with the issue's excludes went from about 12.8s to 5.2s.
a full stack restart went from about 14s to 8s `db start` and `db reset`
get the same.
## how?
containers with a docker healthcheck now get `--health-start-interval
1s` and a 10s start period when `docker version` shows API 1.44 or newer
for the client binary, the client in use, and the daemon, so the first
check runs about 1s in and the interval stays 10s after.
kong's check lived only in its image, so its spec now sets the same
`kong health` check and gets those flags too.
> [!NOTE]
> on engines without the flag (docker below API 1.44, podman) containers
keep the 10s first check.
## ref:
- closes: #7427
Copy file name to clipboardExpand all lines: apps/cli/src/commands/db/reset/SIDE_EFFECTS.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,7 @@ equivalent, PG15) or `InitSchema14`/`ApplyApiPrivileges` (PG14).
100
100
|`docker container inspect supabase_db_<project>`| local path |`AssertSupabaseDbIsRunning` probe (Podman fallback) — spawned only when the direct Engine-API request over the active local socket/named pipe gives no definitive answer |
101
101
|`docker stop <storage\|auth\|realtime\|pooler container>`| local path, PG15 | stop the satellites before removing the db container so their `unless-stopped` restarts cannot race the one-shot init jobs (issue #6915), not-found tolerated per service |
102
102
|`docker container rm -f supabase_db_<project>` / `docker volume rm -f <same>`| local path, PG15 | remove the existing container/volume before recreating (Podman fallback) |
103
+
|`docker version --format ...`| local path, PG15 | once before `docker create`: API >= 1.44 on both ends adds the health start flags (see below) |
|`docker run --rm <realtime\|storage\|gotrue image>`| local path, PG15, per enabled service | the one-shot `initSchema15` migrate jobs (`startSetupLocalDatabase`) |
105
106
|`docker restart <db container>`| local path, PG14 |`RestartDatabase` — pg_cron must restart after `pg_terminate_backend`|
@@ -115,7 +116,10 @@ published Postgres address (2s dial cap). Before the command returns, it waits u
115
116
Docker's first health verdict on the database container (polling `docker container inspect` every
116
117
1s until the status leaves `starting`, the container stops running, or Docker cannot launch its
117
118
health check), so a following `supabase status` does not see `starting`. That wait never fails the
118
-
reset.
119
+
reset. When `docker version` reports API >= 1.44 on both ends, `docker create` also gets
120
+
`--health-start-period 10s --health-start-interval 1s`, so its first check runs about 1s after start
121
+
instead of 10s. Older engines and the Podman CLI get neither flag; the `docker` client on a Podman
122
+
socket reporting API >= 1.44 gets both, Podman drops the interval, and there is no speedup.
119
123
120
124
No subprocess delegation on either target — the remote path's
121
125
`--experimental` schema-files apply is fully native.
0 commit comments