You signed in with another tab or window. Reload to refresh your se
8000
ssion.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CancelledError is a BaseException. It lands in errors and leaves as a
plain raise or as a BaseExceptionGroup (:331-334). The executor.shutdown
handler at :345 does the same thing.
The rpc engine catches Exception only, and its comment
(rpc/client/session.py:256-262) gives the reason: a converted cancellation
never reaches the scope that owns it, so an enclosing fail_after cannot turn
its own expiry into a TimeoutError. rpc/client/_pool.py:287-302 records
that this same defect was present there and was removed.
Caution
inproc/_impl.py has three other except BaseException handlers, at :267, :981 and :1227. Those three are correct. Do not change them. Each runs
a cleanup and then re-raises, which is the one shape that must catch a
cancellation. The comment at :981 explains why its cleanup cannot be
skipped: an abandoned thread stays registered with the Boehm GC.
Scope
Catch Exception in close_resource (:328) and in the executor.shutdown
handler (:345).
Risk
Low. The rpc engine has run this way since its own correction.
Acceptance criteria
CancelledError propagates out of a cancelled close(), and anyio.fail_after around close() raises TimeoutError.
Tests
Two tests, beside the existing rpc test test_a_cancelled_close_still_stops_the_worker_process.
Compatibility
This is a deliberate behaviour change for inproc. A caller that catches the BaseExceptionGroup loses its match. The change aligns inproc with rpc.
Activity
test(asan): skip the runaway-recursion tests, which libasan cannot un…
test(asan): skip the runaway-recursion tests, which libasan cannot un…
fix(inproc): let a cancellation leave Session.close
test(asan): skip the runaway-recursion tests, which libasan cannot un…