postgres
postgres copied to clipboard
Deadlocked/hung pool when connected to Postgres through Supavisor
Hey @porsager, thanks for the package.
Creating this issue mostly in hopes that someone else has ran into this issue.
We use Supabase for our Postgres DB and connect through their pooling service Supavisor in transaction mode; Supavisor is an alternative to pgBouncer (link). On postgres.js side, we set prepare: false.
What we're seeing is that the postgres.js pooler will start swallowing queries at some point. Imagine a function like:
async function userGet(id: string) {
console.log("trying to get the user");
const users = await db<User[]>`SELECT * FROM user WHERE id=${id}`;
console.log("got the user!");
return users;
}
After a while, this will print "trying to get the user" but not "got the user!". Does this ring any bells?
P.S. been trying to find an isolated script to reproduce but unsuccessful so far. the only reproduction is live production traffic.