Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword log message when function raises a cancellation error #2070

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"Recevied a cancellation signal while processing input {input_id}")
mwaskom marked this conversation as resolved.
Show resolved Hide resolved
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("Recevied 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
Loading