From ecf9d56c91051140524f914857694d84f3244f9c Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 25 Jun 2024 19:46:24 -0500 Subject: [PATCH] docs: add listener recovery --- docs/references/listener.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/references/listener.rst b/docs/references/listener.rst index 09af8b200..ad11a3411 100644 --- a/docs/references/listener.rst +++ b/docs/references/listener.rst @@ -47,3 +47,14 @@ This will cause the :ref:`connection_pool` to connect to the read replica host a .. note:: Under the hood, PostgREST forces `target_session_attrs=read-write `_ for the ``LISTEN`` session. + +.. _listener_automatic_recovery: + +Automatic Recovery +================== + +The listener will retry reconnecting to the database if connection loss happens. + +- It will retry forever with exponential backoff, with a maximum backoff time of 32 seconds between retries. Each of these attempts are :ref:`logged `. +- Automatic recovery can be disabled by setting :ref:`db-pool-automatic-recovery` to ``false``. +- To ensure a valid state, the listener reloads the :ref:`schema_cache` and :ref:`configuration` when recovering.