From ff3a3a9100928cb3b0376d18082675a1807db431 Mon Sep 17 00:00:00 2001 From: Taimoor Zaeem Date: Fri, 25 Aug 2023 10:30:04 +0500 Subject: [PATCH] add db-pool-automatic-recovery --- docs/references/configuration.rst | 17 +++++++++++++++++ docs/references/connection_pool.rst | 1 + 2 files changed, 18 insertions(+) diff --git a/docs/references/configuration.rst b/docs/references/configuration.rst index 5da6db953..6cd7217be 100644 --- a/docs/references/configuration.rst +++ b/docs/references/configuration.rst @@ -370,6 +370,23 @@ db-pool-max-lifetime Specifies the maximum time in seconds of an existing connection in the pool. +.. _db-pool-automatic-recovery: + +db-pool-automatic-recovery +-------------------------- + + =============== ================================= + **Type** Boolean + **Default** True + **Reloadable** Y + **Environment** PGRST_DB_POOL_AUTOMATIC_RECOVERY + **In-Database** `n/a` + =============== ================================= + + Enables or disables connection retrying. + + When disabled, PostgREST would terminate immediately after connection loss instead of retrying indefinitely. See :ref:`this section ` for more information. + .. _db-pre-request: db-pre-request diff --git a/docs/references/connection_pool.rst b/docs/references/connection_pool.rst index 6072b4266..efff666c7 100644 --- a/docs/references/connection_pool.rst +++ b/docs/references/connection_pool.rst @@ -78,6 +78,7 @@ The server will retry reconnecting to the database if connection loss happens. - The retries happen immediately after a connection loss, if :ref:`db-channel-enabled` is set to true (the default). Otherwise they'll happen once a request arrives. - To ensure a valid state, the server reloads the :ref:`schema_cache` and :ref:`configuration` when recovering. - To notify the client of the next retry, the server sends a ``503 Service Unavailable`` status with the ``Retry-After: x`` header. Where ``x`` is the number of seconds programmed for the next retry. +- Automatic recovery can be disabled by setting :ref:`db-pool-automatic-recovery` to ``false``. .. _external_connection_poolers: