You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/09/04 09:52:20 UTC

[GitHub] [airflow] ashb commented on a change in pull request #5949: [AIRFLOW-5343] Add pool_pre_ping to SQLAlchemy

ashb commented on a change in pull request #5949: [AIRFLOW-5343] Add pool_pre_ping to SQLAlchemy
URL: https://github.com/apache/airflow/pull/5949#discussion_r320672093
 
 

 ##########
 File path: airflow/settings.py
 ##########
 @@ -173,10 +173,21 @@ def configure_orm(disable_connection_pool=False):
         except conf.AirflowConfigException:
             pool_recycle = 1800
 
+        # Check connection at the start of each connection pool checkout.
+        # Typically, this is a simple statement like “SELECT 1”, but may also make use
+        # of some DBAPI-specific method to test the connection for liveness.
+        # More information here:
+        # https://docs.sqlalchemy.org/en/13/core/pooling.html#disconnect-handling-pessimistic
+        try:
+            pool_pre_ping = conf.getboolean('core', 'SQL_ALCHEMY_POOL_PRE_PING')
 
 Review comment:
   ```suggestion
               pool_pre_ping = conf.getboolean('core', 'SQL_ALCHEMY_POOL_PRE_PING', fallback=False)
   ```
   
   And then we don't need the try/except.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services