Commit eaeb1e0
committed
Document the owning-loop cursor-cascade cost on force_close_transport
When AsyncConnection.force_close_transport is invoked from a
coroutine on the owning loop with many open cursors, the cursor-
cascade walk runs inline — synchronous attribute writes plus a
weakref.proxy swap per cursor. For a connection with hundreds of
open cursors that's measurable loop CPU before the method returns.
The documented intent of the method is loop-already-dead / GC /
atexit / SA-do_terminate paths where the cascade-on-owning-loop
case does not arise, so the behaviour is correct. Surface the
constraint in the docstring so an in-loop caller with many open
cursors picks the cooperative close() instead.
Add a docstring-lint test that pins the wording so a future
refactor cannot silently drop the constraint.1 parent de66887 commit eaeb1e0
2 files changed
Lines changed: 46 additions & 0 deletions
File tree
- src/dqlitedbapi/aio
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1192 | 1192 | | |
1193 | 1193 | | |
1194 | 1194 | | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1195 | 1207 | | |
1196 | 1208 | | |
1197 | 1209 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments