Repository navigation
Commit 0a22fb1
committed
fix(windows): absorb transient file locks when retiring a running image
Release run 30385988475 lost three Windows smoke jobs to one phenomenon on two
different surfaces. A Windows file that was just written or just executed can
refuse deletion and rename for a moment while a scanner reads it or while the OS
finishes reaping a child. Both conditions clear on their own within moments.
It reads as nondeterminism because it is timing: windows-2025 passed both amd64
variants while windows-latest -- the SAME image, windows-2025-vs2026 -- failed
both, and windows-11-arm failed too.
PRODUCT: uninstall abandoned a live installation.
With one binary per platform, uninstall must remove the very image it is
executing, and on Windows a running image can only be renamed, never
overwritten. That rename got a single attempt, so a transient sharing violation
surfaced to the user as
error: failed to remove ...; completed configuration/index cleanup may remain
with the install left half-torn-down. install.ps1 already retries this exact
operation ten times for this exact reason; the C path now does the same, and
only for sharing/access/lock violations, so a file that is genuinely held still
fails closed instead of spinning.
Proven with a failure-injection seam rather than by racing a real scanner:
3 injected failures must still succeed, 64 must still fail AND leave the target
in place. Deterministic, so it does not need CI to learn whether it works.
HARNESS: the smoke killed itself silently.
Phases that install a binary then `rm -rf` the directory hit the same lock. Under
`set -euo pipefail` that returns non-zero and ends the run WITHOUT printing
anything -- the logs jump straight from "OK 13h" to job cleanup with no FAIL
line, which is what made this expensive to read.
None of those 16 removals is an assertion; they are fixture cleanup, and
_smoke.yml already states the principle ("a temp dir on an ephemeral runner must
never fail the job") that smoke-test.sh did not honour. They now go through
smoke_rmtree, which retries so the disk is actually reclaimed -- these fixtures
hold ~300 MB binaries and runners are disk-tight -- then warns and continues.
Verified: Windows VM full smoke ALL PASSED (previously died after 13h), macOS
full smoke ALL PASSED, activation_transaction + cli 259 passed on Windows, all
10 shell contracts pass, lint-ci clean.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 0802689 commit 0a22fb1
4 files changed
Lines changed: 148 additions & 20 deletions
File tree
- scripts
- src/cli
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
71 | 96 | | |
72 | 97 | | |
73 | 98 | | |
| |||
123 | 148 | | |
124 | 149 | | |
125 | 150 | | |
126 | | - | |
| 151 | + | |
127 | 152 | | |
128 | 153 | | |
129 | 154 | | |
| |||
970 | 995 | | |
971 | 996 | | |
972 | 997 | | |
973 | | - | |
| 998 | + | |
974 | 999 | | |
975 | 1000 | | |
976 | 1001 | | |
| |||
986 | 1011 | | |
987 | 1012 | | |
988 | 1013 | | |
989 | | - | |
| 1014 | + | |
990 | 1015 | | |
991 | 1016 | | |
992 | 1017 | | |
| |||
1000 | 1025 | | |
1001 | 1026 | | |
1002 | 1027 | | |
1003 | | - | |
| 1028 | + | |
1004 | 1029 | | |
1005 | 1030 | | |
1006 | 1031 | | |
1007 | 1032 | | |
1008 | | - | |
| 1033 | + | |
1009 | 1034 | | |
1010 | 1035 | | |
1011 | 1036 | | |
| |||
2671 | 2696 | | |
2672 | 2697 | | |
2673 | 2698 | | |
2674 | | - | |
| 2699 | + | |
2675 | 2700 | | |
2676 | 2701 | | |
2677 | 2702 | | |
| |||
2695 | 2720 | | |
2696 | 2721 | | |
2697 | 2722 | | |
2698 | | - | |
| 2723 | + | |
2699 | 2724 | | |
2700 | 2725 | | |
2701 | 2726 | | |
| |||
2708 | 2733 | | |
2709 | 2734 | | |
2710 | 2735 | | |
2711 | | - | |
| 2736 | + | |
2712 | 2737 | | |
2713 | 2738 | | |
2714 | 2739 | | |
| |||
2719 | 2744 | | |
2720 | 2745 | | |
2721 | 2746 | | |
2722 | | - | |
| 2747 | + | |
2723 | 2748 | | |
2724 | 2749 | | |
2725 | 2750 | | |
| |||
2734 | 2759 | | |
2735 | 2760 | | |
2736 | 2761 | | |
2737 | | - | |
| 2762 | + | |
2738 | 2763 | | |
2739 | 2764 | | |
2740 | 2765 | | |
| |||
2748 | 2773 | | |
2749 | 2774 | | |
2750 | 2775 | | |
2751 | | - | |
| 2776 | + | |
2752 | 2777 | | |
2753 | 2778 | | |
2754 | 2779 | | |
| |||
2848 | 2873 | | |
2849 | 2874 | | |
2850 | 2875 | | |
2851 | | - | |
| 2876 | + | |
2852 | 2877 | | |
2853 | 2878 | | |
2854 | 2879 | | |
| |||
3063 | 3088 | | |
3064 | 3089 | | |
3065 | 3090 | | |
3066 | | - | |
| 3091 | + | |
3067 | 3092 | | |
3068 | 3093 | | |
3069 | 3094 | | |
| |||
3083 | 3108 | | |
3084 | 3109 | | |
3085 | 3110 | | |
3086 | | - | |
| 3111 | + | |
3087 | 3112 | | |
3088 | 3113 | | |
3089 | 3114 | | |
| |||
3234 | 3259 | | |
3235 | 3260 | | |
3236 | 3261 | | |
3237 | | - | |
| 3262 | + | |
3238 | 3263 | | |
3239 | 3264 | | |
3240 | 3265 | | |
| |||
3301 | 3326 | | |
3302 | 3327 | | |
3303 | 3328 | | |
3304 | | - | |
| 3329 | + | |
3305 | 3330 | | |
3306 | 3331 | | |
3307 | 3332 | | |
| |||
3356 | 3381 | | |
3357 | 3382 | | |
3358 | 3383 | | |
3359 | | - | |
| 3384 | + | |
3360 | 3385 | | |
3361 | 3386 | | |
3362 | 3387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1121 | 1155 | | |
1122 | 1156 | | |
1123 | 1157 | | |
| |||
1128 | 1162 | | |
1129 | 1163 | | |
1130 | 1164 | | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1134 | 1182 | | |
1135 | 1183 | | |
1136 | 1184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
546 | 593 | | |
547 | 594 | | |
548 | 595 | | |
| |||
972 | 1019 | | |
973 | 1020 | | |
974 | 1021 | | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
975 | 1025 | | |
976 | 1026 | | |
977 | 1027 | | |
| |||
0 commit comments