From be04c98cd3a55aec9c9dd6d1457de5655ad20b30 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 14 Aug 2018 16:27:13 -0700 Subject: [PATCH] [sql lab] always use NullPool (#5612) I think that the only place where we want db connection pooling would be to talk to the metadata database. SQL Lab should close its connections and never pool them. Given that each Gunicorn worker will create its own pool that can lead to way too many connections opened. closes https://github.com/apache/incubator-superset/issues/4666 --- superset/sql_lab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/sql_lab.py b/superset/sql_lab.py index b97761d3ca..a659653d37 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -165,7 +165,7 @@ def execute_sql( try: engine = database.get_sqla_engine( schema=query.schema, - nullpool=not ctask.request.called_directly, + nullpool=True, user_name=user_name, ) conn = engine.raw_connection()