From 34b31cd6e9228fa39f41f138ff0994b179a71914 Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Mon, 5 Aug 2024 11:13:36 -0400 Subject: [PATCH] Reword log message when function raises a cancellation error (#2070) * Reword log message when function raises a cancellation error * Fix typo --- modal/_container_io_manager.py | 2 +- test/container_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modal/_container_io_manager.py b/modal/_container_io_manager.py index ded25a955..9d119c620 100644 --- a/modal/_container_io_manager.py +++ b/modal/_container_io_manager.py @@ -517,7 +517,7 @@ async def handle_input_exception(self, input_id, started_at: float) -> AsyncGene # just skip creating any output for this input and keep going with the next instead # it should have been marked as cancelled already in the backend at this point so it # won't be retried - logger.warning(f"The current input ({input_id=}) was cancelled by a user request") + logger.warning(f"Received a cancellation signal while processing input {input_id}") await self.complete_call(started_at) return except BaseException as exc: diff --git a/test/container_test.py b/test/container_test.py index 02d82c39b..3e3b4906d 100644 --- a/test/container_test.py +++ b/test/container_test.py @@ -1312,7 +1312,7 @@ def test_cancellation_aborts_current_input_on_match( api_pb2.ContainerHeartbeatResponse(cancel_input_event=api_pb2.CancelInputEvent(input_ids=cancelled_input_ids)) ) stdout, stderr = container_process.communicate() - assert stderr.decode().count("was cancelled by a user request") == live_cancellations + assert stderr.decode().count("Received a cancellation signal") == live_cancellations assert "Traceback" not in stderr.decode() assert container_process.returncode == 0 # wait for container to exit duration = time.monotonic() - t0 # time from heartbeat to container exit