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.