From 73b1a48057a1a2e765e13f8538e8c84d91f1f6cc Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 27 Aug 2023 12:01:41 +0200 Subject: [PATCH] Drop RecursiveMiddleware It isn't used AFAICT and makes 3 copies of the request environ each, without ever being used. Shows up in a memray trace, though this also shouldn't cause a memory leak ... --- lib/galaxy/webapps/galaxy/buildapp.py | 6 ------ lib/galaxy/webapps/reports/buildapp.py | 6 ------ lib/tool_shed/webapp/buildapp.py | 5 ----- 3 files changed, 17 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 672292bb629..e7e95ca9670 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -1285,12 +1285,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf): normalize_remote_user_email=conf.get("normalize_remote_user_email", False), ), ) - # The recursive middleware allows for including requests in other - # requests or forwarding of requests, all on the server side. - if asbool(conf.get("use_recursive", True)): - from paste import recursive - - app = wrap_if_allowed(app, stack, recursive.RecursiveMiddleware, args=(conf,)) # Error middleware app = wrap_if_allowed(app, stack, ErrorMiddleware, args=(conf,)) diff --git a/lib/galaxy/webapps/reports/buildapp.py b/lib/galaxy/webapps/reports/buildapp.py index cdc57f477ae..da3e74d3a93 100644 --- a/lib/galaxy/webapps/reports/buildapp.py +++ b/lib/galaxy/webapps/reports/buildapp.py @@ -86,12 +86,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf): # wrapped around the application (it can interact poorly with # other middleware): app = wrap_if_allowed(app, stack, httpexceptions.make_middleware, name="paste.httpexceptions", args=(conf,)) - # The recursive middleware allows for including requests in other - # requests or forwarding of requests, all on the server side. - if asbool(conf.get("use_recursive", True)): - from paste import recursive - - app = wrap_if_allowed(app, stack, recursive.RecursiveMiddleware, args=(conf,)) # Error middleware app = wrap_if_allowed(app, stack, ErrorMiddleware, args=(conf,)) diff --git a/lib/tool_shed/webapp/buildapp.py b/lib/tool_shed/webapp/buildapp.py index ef0e5d9cefe..7565a7a2d98 100644 --- a/lib/tool_shed/webapp/buildapp.py +++ b/lib/tool_shed/webapp/buildapp.py @@ -259,12 +259,7 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf): normalize_remote_user_email=conf.get("normalize_remote_user_email", False), ), ) - # The recursive middleware allows for including requests in other - # requests or forwarding of requests, all on the server side. - if asbool(conf.get("use_recursive", True)): - from paste import recursive - app = wrap_if_allowed(app, stack, recursive.RecursiveMiddleware, args=(conf,)) # Transaction logging (apache access.log style) if asbool(conf.get("use_translogger", True)): from paste.translogger import TransLogger