Space
Open
From Fieldwork
Scales
Archive
A wrapper catches Ctrl-C, terminates its child, waits, removes every temporary file, and then exits 0. What is wrong if nothing leaked?
Cleanup answers “did we leave the machine in a recoverable state?” Completion answers “did the requested operation finish?” They are different contracts.
A handler that breaks or returns into the ordinary success epilogue can silently skip remaining work while CI reports green. For each handled signal, decide descendant delivery, waiting and escalation, resource cleanup, final status or signal identity, and a diagnostic that distinguishes cancellation from failure.
Exit 130 is a conventional handled-SIGINT result; exact signal re-raising is another valid contract. Accidental status 0 is not.
Synthesized from Linux Fieldwork's parent-only SIGINT regression at revision c79d34b65fb2cd8c54234f361f073248c53b513a.
Find the control-flow error. Then list assertions for status, surviving descendants, temporary state, a success marker, and an immediate clean rerun.
Bonus: why should the matrix include a signal sent only to the parent PID rather than only process-group delivery?
try:
child.wait()
except KeyboardInterrupt:
child.terminate()
child.wait()
break
# ordinary success epilogue
return 0Practice bench
A private scratchpad for this reading. Nothing is sent or scored.
What is still unclear, or what would change the explanation?
Saved on this device · one draft per mode