From cf8fc114a0295519ef2d42625b7a8e46b274b079 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 27 Aug 2023 16:25:28 +0200 Subject: [PATCH] Drop expunge_all() call in WebTransactionRequest We're always getting a clean request_id scoped session, so this shouldn't be necessary. It shows up in memray traces as allocating memory that doesn't get freed (which I don't understand, it's WeakInstanceDict instances). --- lib/galaxy/managers/context.py | 11 ----------- lib/galaxy/webapps/base/webapp.py | 1 - 2 files changed, 12 deletions(-) diff --git a/lib/galaxy/managers/context.py b/lib/galaxy/managers/context.py index 2a19c85ef53..a36ceecb396 100644 --- a/lib/galaxy/managers/context.py +++ b/lib/galaxy/managers/context.py @@ -159,17 +159,6 @@ class ProvidesAppContext: """ return self.app.model.session - def expunge_all(self): - """Expunge all the objects in Galaxy's SQLAlchemy sessions.""" - app = self.app - context = app.model.context - context.expunge_all() - # This is a bit hacky, should refctor this. Maybe refactor to app -> expunge_all() - if hasattr(app, "install_model"): - install_model = app.install_model - if install_model != app.model: - install_model.context.expunge_all() - def get_toolbox(self): """Returns the application toolbox. diff --git a/lib/galaxy/webapps/base/webapp.py b/lib/galaxy/webapps/base/webapp.py index 1223712fb03..8897914e60e 100644 --- a/lib/galaxy/webapps/base/webapp.py +++ b/lib/galaxy/webapps/base/webapp.py @@ -308,7 +308,6 @@ class GalaxyWebTransaction(base.DefaultWebTransaction, context.ProvidesHistoryCo self.user_manager = app[UserManager] self.session_manager = app[GalaxySessionManager] super().__init__(environ) - self.expunge_all() config = self.app.config self.debug = asbool(config.get("debug", False)) x_frame_options = getattr(config, "x_frame_options", None)