potiuk commented on code in PR #50960:
URL: https://github.com/apache/airflow/pull/50960#discussion_r2128373475


##########
providers/fab/src/airflow/providers/fab/www/app.py:
##########
@@ -101,9 +96,12 @@ def create_app(enable_plugins: bool):
         elif isinstance(get_auth_manager(), FabAuthManager):
             init_api_auth_provider(flask_app)
             init_api_error_handlers(flask_app)
+            init_airflow_session_interface(flask_app)
         init_jinja_globals(flask_app, enable_plugins=enable_plugins)
-        init_airflow_session_interface(flask_app)
         init_wsgi_middleware(flask_app)
+        from flask_appbuilder.extensions import db
+
+        db.engine.dispose(close=True)

Review Comment:
   @potiuk @vincbeck @dpgaspar - I think we need to understand why we have to 
do it here. If we don't the number of connections established to the database 
grows infinitely when multiple apps are initialized in a single interpreter - 
generally the connections **should be|**  ref-count or garbage-collector 
cleaned, but they are not.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to