Commit fa14e6d
committed
fix(hooks): Windows has no polite stop, and asking for one killed the console
`background_stop` opened with what looked like the symmetric counterpart of the
POSIX side's SIGTERM-then-grace:
::GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, ::GetProcessId(procH));
That call addresses a process GROUP attached to the CALLER's console, not a
process. When the id does not name a live group of ours — and it does not, once
the child has already exited, which `start /b`-style commands do immediately —
the event reaches everything sharing that console instead.
Measured on the Windows e2e runner: the entire suite died eleven seconds into
the hooks test with exit code -1073741510 (0xC000013A, STATUS_CONTROL_C_EXIT)
and printed no summary at all, because mcpp had sent Ctrl-Break to its own
console. Nothing local can show this: the branch is #if'd out everywhere the
code is developed, and the failure is not in the feature under test — it is the
harness dying.
The design document already said Windows has no graceful stop for a child with
no console and no window of its own. The implementation did not believe it. The
call is removed, `graceMs` is explicitly unspent on that platform, and the
asymmetry with POSIX is stated in the declaration instead of faked with a call
that reaches too far. The job object was always the mechanism.
macOS ARM64 and Linux both ran the new e2e green on the previous commit
(317_project_build_hooks.sh, 21s on macOS), so the POSIX half — process groups,
the grandchild kill, and Ctrl-C cleanup — is confirmed on two OSes.1 parent dd6a5f6 commit fa14e6d
2 files changed
Lines changed: 45 additions & 16 deletions
File tree
- .agents/docs
- modules/platform/src/windows
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
474 | 478 | | |
475 | 479 | | |
476 | 480 | | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
488 | 506 | | |
489 | 507 | | |
490 | 508 | | |
| |||
0 commit comments