Skip to content

OPEN-48

A cancel ends a paused run at once instead of being refused.

What was open

INT-16 refused a new inward signal while any was pending, and a paused run keeps its pause signal pending as its resume key (INT-5). So a cancel sent to a paused run was refused with INWARD_SIGNAL_ALREADY_PENDING, and the operator had to resume the run, letting its nodes execute again, before a cancel could land.

Decision

A cancel is refused with INWARD_SIGNAL_ALREADY_PENDING only while another cancel is pending; a pause is still refused while any inward signal is pending. A cancel accepted for a paused run, whatever paused it (a pause signal, a budget, an outward interrupt), ends the run at once (INT-25): no engine loop is running to observe it at a job boundary, and none is started. The cancel claims the run by one atomic change from paused to cancelled, against a resume signal, an interrupt answer and a worker's auto-resume alike; whichever claims the run first wins, and a resume that loses is refused with PIPELINE_TERMINAL. Ending the run cancels its pause signal, active jobs and pending outward interrupts, marks the cancel signal resolved, and announces the outcome once as INT-5 announces a cancel, answering 202. The ending survives a crash without a second announcement. A run with a cancel pending is never left paused: the cancel is observed instead. A cancel observed at a job boundary of a running run (INT-5) also marks the cancel signal resolved, so its final status does not depend on whether the run was paused. A caller cannot cancel a pending cancel signal through the interrupt cancel (INT-24): that would undo a cancellation already accepted. It is refused with 409 and CANCEL_SIGNAL_NOT_CANCELLABLE. A pause signal not yet observed by a running run may still be withdrawn.

Rules affected