From d527117aca4940ffb666396e4536b7c3cdc16c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20Jer=C5=A1e?= Date: Tue, 5 Dec 2023 09:32:17 +0100 Subject: [PATCH] Wrap listener command processing in a transaction --- docs/CHANGELOG.rst | 4 ++++ resolwe/flow/managers/listener/listener.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 08fc9c1de..5e4ccafd2 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -22,6 +22,10 @@ Added - Add ``extend_lock`` method to redis cache in listener - Add extending processing lock task to the listener +Changed +------- +- Wrap listener command processing in a transaction + =================== 38.1.0 - 2023-11-21 diff --git a/resolwe/flow/managers/listener/listener.py b/resolwe/flow/managers/listener/listener.py index d3c9645d6..88a40540b 100644 --- a/resolwe/flow/managers/listener/listener.py +++ b/resolwe/flow/managers/listener/listener.py @@ -407,7 +407,8 @@ def process_command(self, identity: PeerIdentity, message: Message) -> Response: try: logger.debug(__("Invoking handler {}.", handler_name)) - response = handler(data_id, message, self) + with transaction.atomic(): + response = handler(data_id, message, self) # Check if data status was changed by the handler. if self.get_data_fields(data_id, "status") == Data.STATUS_ERROR: response.status = ResponseStatus.ERROR