Closed steve-chavez closed 3 months ago
Turns out it's possible for a segfault in a background worker to crash the whole cluster, see https://www.postgresql.org/message-id/flat/16233-d3f4c2bf4d76018e%40postgresql.org.
I'll close this by explicitly handling all cases where a NULL might be obtained in the worker code.
Problem
In some rare cases, pg_net reports:
The thing is that a segmentation fault in pg_net should only kill its worker but somehow this restarts the whole cluster.
This thread https://www.postgresql.org/message-id/flat/871rucdwkt.fsf%40alfa.kjonca indicates that this could be an UNLOGGED table bug.
So far I haven't been able to reproduce this, some Supabase tickets indicate that this can happen sometimes when invoking edge functions.
Solution
https://github.com/supabase/pg_net/issues/62 is a possible solution. Since we would not need the UNLOGGED table for the queue.