PostgREST / postgrest

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

The schema cache load is not retried with exponential backoff #3523

Open steve-chavez opened 1 month ago

steve-chavez commented 1 month ago

Problem

Adding the following on test/spec/fixtures/schema.sql:

alter role postgrest_test_authenticator set statement_timeout to '10'

Makes the schema cache retry load on an endless loop without backoff:

# $ postgrest-with-postgresql-16 -f test/spec/fixtures/load.sql postgrest-run 
# ...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...
08/May/2024:21:06:46 +0200: Attempting to connect to the database...

Previously reported on https://github.com/PostgREST/postgrest/issues/3424#issuecomment-2101258619

steve-chavez commented 1 month ago

Still an issue, this was incorrectly closed by #3536