Skip to content

No expiry is a sentinel, and an expiry ends the run whichever path finds it

An interrupt with no expiry waits indefinitely, and survives every sweep. When one does expire, it does not matter whether a sweep or a late answer found it: the run it held open can no longer be resumed, so it ends the same way either way.

The rule

Normative: this is the rule
  1. An interrupt MUST wait indefinitely unless it carries a positive expiry.
  2. An absent or zero expiry is the no-expiry sentinel: it MUST NOT be treated as overdue, and any sweep MUST exclude it, so an open-ended question to a human is never reaped.
  3. A pending outward interrupt past its expiry is expired by whichever path reaches it first: a sweep, or a caller's answer or cancel (INT-24) that arrives after the expiry.
  4. Every path MUST set it expired (INT-24), record it, and announce the expiry.
  5. An answer or cancel that finds an outward interrupt past its expiry MUST expire it and MUST be refused with 409 and the code INTERRUPT_NOT_PENDING (INT-24), as if the sweep had come first.
  6. An inward signal is settled as INT-5, INT-16, INT-24 and INT-25 say, whatever its expiry.
  7. The path MUST make no difference to what follows: an expired outward interrupt ends the run it holds open (INT-18), whether a sweep or a late answer found it.

What it means

Two different shapes both mean "wait indefinitely" — a missing expiry and one set to zero — and a sweep has to exclude both, or an open-ended question to a human would be reaped the first time the sweep runs. Treating only one of the two as the sentinel is the mistake this rule rules out.

Several paths can find an outward interrupt past its expiry: a sweep that looks for overdue rows, and a caller whose answer or cancel arrives too late. Whichever gets there first sets the interrupt expired, records it and announces it; the late answer or cancel is refused with 409 INTERRUPT_NOT_PENDING either way. What follows does not depend on the path. A run waiting on an outward interrupt that has expired can never be resumed by it, so the run ends (INT-18). An inward signal is different: a paused run's pause signal is its resume key, so it is settled only by the signal rules, whatever its expiry. Letting a late answer expire the question but leave the run paused would only strand the run until the next sweep, or forever if the sweep no longer sees the row as pending.

Example

An interrupt with no expiry setnever expires
{"expires": null}
An interrupt whose expiry is zeronever expires
{"expires": 0}

Both stay pending through every sweep, and both are still answerable long after they were created.

Why

Recorded under OPEN-25, OPEN-47, OPEN-46.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · INT-23 · changed in spec 1.1