Commit 115985e
committed
Break reference cycles and purge stale caches in ctable layer
- _RowIndexer: use weakref to parent CTable to break reference
cycles, allowing CTable instances to be collected without gen-2 GC.
- indexing.py: stop caching writable sidecar handles in the
process-wide _SIDECAR_HANDLE_CACHE after construction — they kept
NDArray objects alive indefinitely across tests on macOS/Python 3.14.
- indexing.py: add _purge_stale_persistent_caches() to evict index
cache entries whose backing paths no longer exist. Call it in
_load_store, _open_query_cache_store, _open_sidecar_handle, and
_gather_mmap_source.
- ref.py: open urlpath operands in mode='r' instead of the default
mode='a'; persistent recipe operands only need read access.
- test_ctable_indexing.py: add tests verifying that sidecar handles
are not cached after index creation, that CTables release without
explicit GC, and that stale persistent caches are purged correctly.1 parent 7defba4 commit 115985e
4 files changed
Lines changed: 130 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
451 | | - | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
454 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
455 | 459 | | |
456 | 460 | | |
457 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
109 | 151 | | |
110 | 152 | | |
111 | 153 | | |
| |||
286 | 328 | | |
287 | 329 | | |
288 | 330 | | |
| 331 | + | |
289 | 332 | | |
290 | 333 | | |
291 | 334 | | |
| |||
405 | 448 | | |
406 | 449 | | |
407 | 450 | | |
| 451 | + | |
408 | 452 | | |
409 | 453 | | |
410 | 454 | | |
| |||
920 | 964 | | |
921 | 965 | | |
922 | 966 | | |
| 967 | + | |
923 | 968 | | |
924 | 969 | | |
925 | 970 | | |
| |||
1108 | 1153 | | |
1109 | 1154 | | |
1110 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1111 | 1159 | | |
1112 | | - | |
| 1160 | + | |
1113 | 1161 | | |
1114 | 1162 | | |
1115 | 1163 | | |
| |||
1152 | 1200 | | |
1153 | 1201 | | |
1154 | 1202 | | |
1155 | | - | |
| 1203 | + | |
1156 | 1204 | | |
1157 | 1205 | | |
1158 | | - | |
1159 | 1206 | | |
1160 | 1207 | | |
1161 | 1208 | | |
| |||
4874 | 4921 | | |
4875 | 4922 | | |
4876 | 4923 | | |
| 4924 | + | |
4877 | 4925 | | |
4878 | 4926 | | |
4879 | 4927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
226 | 254 | | |
227 | 255 | | |
228 | 256 | | |
| |||
250 | 278 | | |
251 | 279 | | |
252 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
253 | 303 | | |
254 | 304 | | |
255 | 305 | | |
| |||
465 | 515 | | |
466 | 516 | | |
467 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
0 commit comments