From 5cbe5412a7caf566a1bee0fcddad7d1d9e3ab8ca Mon Sep 17 00:00:00 2001 From: Pantelis Kouris Date: Tue, 3 May 2022 11:40:56 +0200 Subject: [PATCH] Issue 266 (#267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Set pool_pre_ping to True * added comment for issue #266 Co-authored-by: Dion Häfner Co-authored-by: Dion Häfner --- terracotta/drivers/relational_meta_store.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terracotta/drivers/relational_meta_store.py b/terracotta/drivers/relational_meta_store.py index 30c60bf7..794809d3 100644 --- a/terracotta/drivers/relational_meta_store.py +++ b/terracotta/drivers/relational_meta_store.py @@ -88,7 +88,9 @@ def __init__(self, path: str) -> None: self.url, echo=False, future=True, - connect_args={self.SQL_TIMEOUT_KEY: db_connection_timeout} + connect_args={self.SQL_TIMEOUT_KEY: db_connection_timeout}, + # automatically re-spawn stale connections, see terracotta#266 + pool_pre_ping=True ) self.sqla_metadata = sqla.MetaData()