Skip to content

Commit f528d50

Browse files
Cover the cancellation request in the repeated-interrupt note
A second interrupt or task cancellation also escapes while the cancellation request is in progress, not only during the follow-up wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent da16975 commit f528d50

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎docs/aio.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ requests cancellation of the query, waits until it reaches a terminal state, and
139139
Cancellation is a best-effort request, so the query can still end as `SUCCEEDED` or `FAILED`.
140140
The `query_id` property keeps the ID of the cancelled query.
141141
If the cancellation request fails, `asyncio.CancelledError` is raised with the error as its cause.
142-
Cancelling the task again during that wait raises `asyncio.CancelledError` without waiting for the terminal state.
142+
Cancelling the task again during the cancellation request or that wait raises `asyncio.CancelledError` immediately, and the query can keep running.
143143
With `kill_on_interrupt=False`, `asyncio.CancelledError` is raised immediately and the query keeps running.
144144

145145
A timeout from `asyncio.wait_for()` that expires while `execute()` waits for the query therefore cancels the query

‎docs/usage.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ requests cancellation, waits until the query reaches a terminal state, and then
508508
Cancellation is a best-effort request, so the query can still end as `SUCCEEDED` or `FAILED`.
509509
The `query_id` property keeps the ID of the interrupted query.
510510
If the cancellation request fails, the `KeyboardInterrupt` propagates with the error as its cause.
511-
A second `KeyboardInterrupt` during that wait propagates without waiting for the terminal state.
511+
A second `KeyboardInterrupt` during the cancellation request or that wait propagates immediately, and the query can keep running.
512512
With `kill_on_interrupt=False`, the `KeyboardInterrupt` propagates immediately and the query keeps running.
513513

514514
```python

0 commit comments

Comments
 (0)