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()