Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions,
and Discord- just the public docs and discussions.
Describe the bug
Stopping the postgres-meta container takes more than 10 seconds every time and prints a warning, unlike the postgres and postgrest containers, which stop immediately and print nothing.
To Reproduce
On a clean Fedora 39 system without other containers, install podman and podman-compose, then run the following script as user. The postgrest service without access control is there to show that the issue doesn't affect it, only postgres-meta.
#!/bin/bash
set -e
rm -rf ~/postgres-meta-slow-stop
mkdir ~/postgres-meta-slow-stop
cd ~/postgres-meta-slow-stop
cat >docker-compose.yaml <<'EOF'
version: '3'
services:
db:
image: docker.io/postgres
environment:
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
rest:
image: docker.io/postgrest/postgrest
ports:
- 3000:3000
environment:
PGRST_DB_URI: postgres://postgres:$POSTGRES_PASSWORD@db:5432/postgres
PGRST_DB_ANON_ROLE: postgres
depends_on:
- db
meta:
image: docker.io/supabase/postgres-meta:v0.75.0
environment:
PG_META_DB_URL: postgres://postgres:$POSTGRES_PASSWORD@db:5432/postgres
depends_on:
- db
EOF
POSTGRES_PASSWORD=password podman-compose up -d
podman exec -i "$(podman ps -aqf name=_db)" psql -U postgres <<EOF
create table person(id uuid primary key, name text);
notify pgrst, 'reload schema';
EOF
podman exec -i "$(podman ps -aqf name=_meta)" env PG_META_GENERATE_TYPES=typescript node dist/server/server.js >database.ts
podman-compose down
Expected behavior
The postgres-meta container should take at most 1 second to stop, like postgrest and postgres, and print no warning.
Screenshots
Relevant part of the output of the commands run by the script above:
podman stop -t 10 postgres-meta-slow-stop_meta_1
WARN[0010] StopSignal SIGTERM failed to stop container postgres-meta-slow-stop_meta_1 in 10 seconds, resorting to SIGKILL
postgres-meta-slow-stop_meta_1
exit code: 0
System information
- OS: Fedora Silverblue 39
- podman-compose version: 1.0.6
- podman version: 4.8.0
Additional context
The Silverblue clarification isn't relevant here I think, on Debian the stop was also slow. But the reason I use the container at all, rather than the npm package, is that installing the dependencies of the npm package throws an error on Silverblue: launchql/libpg-query-node#25