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