PostgREST / postgrest

REST API for any Postgres database
https://postgrest.org
MIT License
22.65k stars 1k forks source link

fix: listener silent fail on replica #3533

Closed steve-chavez closed 1 month ago

steve-chavez commented 1 month ago

Update hasql-notifications to include the fix on https://github.com/diogob/hasql-notifications/issues/24.

Which now reveals the following error:

$ postgrest-with-postgresql-16 --replica -f test/spec/fixtures/load.sql postgrest-run

17/May/2024:18:35:38 -0500: Successfully connected to PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.0, 64-bit
17/May/2024:18:35:38 -0500: Failed listening for notifications on the "pgrst" channel. ERROR:  cannot execute LISTEN during recovery
17/May/2024:18:35:38 -0500: Retrying listening for notifications...

This is still not good because the LISTEN channel will be retried forever (with an unnecessary schema cache reload too) without a backoff.

steve-chavez commented 1 month ago

This is still not good because the LISTEN channel will be retried forever (with an unnecessary schema cache reload too) without a backoff.

Tried to fix that here but it's causing some test failures that only occur on CI (hard to debug). Will make the backoff in another PR to have less changes to track.

Linkcheck fails Patreon permanently.