From 91e864d0086a9e318ea49dc11a61a429f9fbddc0 Mon Sep 17 00:00:00 2001 From: TheBurchLog <5104941+TheBurchLog@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:40:33 -0400 Subject: [PATCH] Fixed sub thread issue with cloning current request --- CHANGELOG.rst | 1 + brewtils/plugin.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bf0a25ec..34d51d9e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ TBD - Updated Plugin `max_concurrent` to support -1 to utilize the default formula that `concurrent.futures.ThreadPoolExecutor` supports `min(32, os.cpu_count() + 4)` - Updated SystemClient to utilize the local Garden name for default Namespace if none can be determined - Updated default Garden version to `UNKNOWN` +- Updated `get_current_request_read_only` to support sub threads calling where current_request is not populated 3.27.2 ------ diff --git a/brewtils/plugin.py b/brewtils/plugin.py index b5b37e8b..830661c2 100644 --- a/brewtils/plugin.py +++ b/brewtils/plugin.py @@ -53,7 +53,7 @@ def get_current_request_read_only(): Returns a copy of the current request, modifications to this object do not impact the actual current request """ - return copy.deepcopy(request_context.current_request) + return copy.deepcopy(getattr(request_context, "current_request", None)) class Plugin(object):