supabase / supavisor

A cloud-native, multi-tenant Postgres connection pooler.
https://supabase.github.io/supavisor/
Apache License 2.0
1.66k stars 55 forks source link

Hosted Supavisor closes connection executing query with large result set #294

Closed mqp closed 5 months ago

mqp commented 5 months ago

Bug report

Describe the bug

When connecting to my Supabase-hosted Supavisor using any client and executing a query that returns a sufficiently large amount of data (order of a gigabyte), Supavisor closes the connection during execution. I identified this with a real query we were running on our backend, but it's easy to reproduce with any old query, e.g. select generate_series(1, 100000000).

It fails reliably every time after about the same time limit. Other long-running queries work OK. It works fine when connecting to the instance directly, and was working fine with pgbouncer.

To Reproduce

image

Additional context

Supabase project ID: pxidrgkatumlvfqaxcll Postgres version: 15.1

abc3 commented 5 months ago

Thanks for this finding! We have finished a fix and it will be rolled out on production soon.