Commit 417ad35
committed
fix(core.utils): only treat bare EACCES as a Windows sharing violation
Roborev review #1744 (medium): the EACCES fallback in
``_is_windows_sharing_violation`` (and the matching branches in the
retry helpers) accepted any ``EACCES`` even when ``winerror`` was set
to a non-sharing code -- silently swallowing real config failures
that the OS named (e.g. winerror 1224, ERROR_USER_MAPPED_FILE).
Tighten the predicate: ``EACCES`` only counts as transient when
``winerror`` is absent. ``io.open`` surfaces pending-delete /
share-mode mismatches as bare ``EACCES`` with no winerror; that's
what the fallback exists to handle. When ``winerror`` IS set and is
not in the sharing set, the OS told us exactly what failed and we
must propagate.
Replace the inline branches in ``_unlink_with_sharing_retry`` and
``_stat_and_read_with_sharing_retry`` with calls to the now-tighter
``_is_windows_sharing_violation`` so all three sites behave
identically.
Roborev review #1748 (medium): ``__len__`` counts orphan files left
behind after a ``_KEY_SCHEMA_VERSION`` bump (per the prior commit's
intentional drop of the schema-mismatch wipe). Document the looseness
on both ``ProgramCacheResource.__len__`` and
``FileStreamProgramCache.__len__`` so callers know not to rely on
exactness across schema bumps.
Tests cover the predicate's table of cases, including the regression
the fix targets (non-sharing winerror + EACCES propagates).1 parent 97dd2bf commit 417ad35
2 files changed
Lines changed: 106 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
1090 | 1098 | | |
1091 | 1099 | | |
1092 | 1100 | | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
| 1101 | + | |
1097 | 1102 | | |
1098 | 1103 | | |
1099 | 1104 | | |
| |||
1191 | 1196 | | |
1192 | 1197 | | |
1193 | 1198 | | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1194 | 1207 | | |
1195 | 1208 | | |
1196 | 1209 | | |
1197 | 1210 | | |
1198 | 1211 | | |
1199 | 1212 | | |
1200 | | - | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
1201 | 1216 | | |
1202 | 1217 | | |
1203 | 1218 | | |
| |||
1228 | 1243 | | |
1229 | 1244 | | |
1230 | 1245 | | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
| 1246 | + | |
1235 | 1247 | | |
1236 | 1248 | | |
1237 | 1249 | | |
| |||
1437 | 1449 | | |
1438 | 1450 | | |
1439 | 1451 | | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1443 | 1463 | | |
1444 | 1464 | | |
1445 | 1465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 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 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
840 | 913 | | |
841 | 914 | | |
842 | 915 | | |
| |||
0 commit comments