Skip to content

Commit

Permalink
Reword log message when function raises a cancellation error (#2070)
Browse files Browse the repository at this point in the history
* Reword log message when function raises a cancellation error

* Fix typo
  • Loading branch information
mwaskom committed Aug 5, 2024
1 parent b3c3b7e commit 34b31cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modal/_container_io_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34b31cd

Please sign in to comment.