fix: listener retries with exponential backoff
Also corrects the admin ready response which now considers the listener state.
This commit is contained in:
committed by
Steve Chavez
parent
bfa4e1bedb
commit
3cf565614d
+2
-2
@@ -733,8 +733,8 @@ def test_admin_ready_includes_schema_cache_state(defaultenv, metapostgrest):
|
||||
|
||||
# force a reconnection so the new role setting is picked up
|
||||
postgrest.process.send_signal(signal.SIGUSR1)
|
||||
# wait 600ms to finish schema cache reload attempt
|
||||
time.sleep(0.6)
|
||||
|
||||
postgrest.wait_until_scache_starts_loading()
|
||||
|
||||
response = postgrest.admin.get("/ready", timeout=1)
|
||||
assert response.status_code == 503
|
||||
|
||||
@@ -20,7 +20,12 @@ def test_sanity_replica(replicaenv):
|
||||
response = postgrest.session.get("/items?select=count")
|
||||
assert response.text == '[{"count":10}]'
|
||||
|
||||
with run(env=replicaenv["replica"]) as postgrest:
|
||||
working_replica_env = {
|
||||
**replicaenv["replica"],
|
||||
"PGRST_DB_CHANNEL_ENABLED": "false", # LISTEN doesn't work on read replicas
|
||||
}
|
||||
|
||||
with run(env=working_replica_env) as postgrest:
|
||||
response = postgrest.session.get("/rpc/is_replica")
|
||||
assert response.text == "true"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user