Commit 7533b87
committed
fix(core.utils): narrow PermissionError swallowing to sharing violations
Roborev review #1735 flagged two issues with the unlink-retry commit:
1. **HIGH**: schema-mismatch wipe in __init__ suppressed every
PermissionError then advanced the schema marker anyway. If a
Windows-locked entry survived the wipe, future opens would skip
the wipe and lookups could return bytes from the incompatible
old format.
2. **MEDIUM**: _enforce_size_cap and _prune_if_stat_unchanged
suppressed every PermissionError, hiding real configuration
failures (POSIX ACL issues, Windows non-sharing winerrors).
Fix: add ``_is_windows_sharing_violation(exc)`` so best-effort callers
can filter the exhausted-Windows-sharing case while letting other
PermissionError instances propagate. Apply at:
* ``_prune_if_stat_unchanged``: catch + filter; non-sharing PE re-raises.
* Schema-mismatch wipe: track ``wipe_complete``; only advance the
schema marker if every old entry was successfully removed.
* ``_enforce_size_cap``: catch + filter.
Tests cover the new propagation paths (POSIX PermissionError surfaces,
not silently swallowed) and the schema-marker preservation when an
old entry is locked.1 parent 1935497 commit 7533b87
2 files changed
Lines changed: 111 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1197 | 1214 | | |
1198 | 1215 | | |
1199 | 1216 | | |
| |||
1208 | 1225 | | |
1209 | 1226 | | |
1210 | 1227 | | |
1211 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1212 | 1231 | | |
1213 | 1232 | | |
1214 | 1233 | | |
| |||
1254 | 1273 | | |
1255 | 1274 | | |
1256 | 1275 | | |
1257 | | - | |
| 1276 | + | |
1258 | 1277 | | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1259 | 1286 | | |
1260 | 1287 | | |
1261 | 1288 | | |
| |||
1348 | 1375 | | |
1349 | 1376 | | |
1350 | 1377 | | |
1351 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1352 | 1384 | | |
1353 | | - | |
| 1385 | + | |
1354 | 1386 | | |
1355 | | - | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1356 | 1395 | | |
1357 | 1396 | | |
1358 | 1397 | | |
| |||
1559 | 1598 | | |
1560 | 1599 | | |
1561 | 1600 | | |
1562 | | - | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
1563 | 1604 | | |
1564 | 1605 | | |
1565 | 1606 | | |
1566 | | - | |
| 1607 | + | |
1567 | 1608 | | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
817 | 877 | | |
818 | 878 | | |
819 | 879 | | |
| |||
0 commit comments