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


##########
providers/fab/src/airflow/providers/fab/www/extensions/init_appbuilder.py:
##########
@@ -176,7 +168,13 @@ def init_app(self, app, session):
         app.config.setdefault("AUTH_RATE_LIMITED", self.auth_rate_limited)
         app.config.setdefault("AUTH_RATE_LIMIT", self.auth_rate_limit)
 
-        self.app = app
+        self._init_extension(app)
+        # init flask-sqlalchemy if needed
+        if "sqlalchemy" not in app.extensions:
+            from flask_appbuilder.extensions import db
+
+            db.init_app(app)
+            db.engine.dispose(close=True)

Review Comment:
   Same here:
   
   @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