Skip to content

A polling job is a wait the engine checks itself, not an interrupt

Nobody answers a poll. The engine goes back to the outside work on its own, so the run is still running, nothing about the wait looks like an interrupt, and a signal does not sit waiting for a job boundary that will not come.

The rule

Normative: this is the rule
  1. A job is polling (PIPE-10) while it waits on external work that it started and that the engine checks for itself, by executing the job again with the state it parked.
  2. Between checks a polling job MUST NOT be in flight.
  3. Between checks it MUST NOT hold a worker.
  4. The interval between checks, any backoff and the deadline are the implementation's own.
  5. A polling job whose deadline passes MUST fail, and that failure is routed like any other node failure (ERR-1, ERR-3, EDGE-6).
  6. A polling job is not an interrupt: it MUST NOT appear on any surface that publishes interrupts, and a request to answer or to cancel an interrupt MUST NOT act on it.
  7. A run is only polling when at least one of its jobs is polling and none is pending, dispatched, running or interrupted.
  8. A run that is only polling, and that no pause holds, MUST have the status running.
  9. Its pendingInterrupt (PIPE-1) MUST be null.
  10. A pause or a cancel accepted for a run that is only polling MUST take effect without waiting for a check.
  11. This is the exception to INT-5, which waits for a job boundary that this run does not have; the signal is otherwise handled and announced as INT-5 says.
  12. When the run reaches a terminal status, a polling job takes the final status PIPE-10 gives a job whose work has started: cancelled.
  13. While a run is paused, its polling jobs MUST NOT be checked; a check that falls due during the pause is made after the run resumes.

What it means

Some nodes start work somewhere else and then have to wait for it: a batch job, a render, a long export. One way to wait is to ask the remote to call back, which is an interrupt (INT-20). The other is for the engine to look again itself, every so often, until the work is done or a deadline passes. That second way is polling. Between two looks the job is parked: nothing executes it, and no worker is tied up holding it.

Nobody answers a poll, so it borrows nothing from interrupts. It does not show up in an inbox or an interrupt listing, an interrupt answer or cancel cannot reach it, and the run is not paused by it. A run that is only polling, with nothing ready, in flight or waiting on an interrupt, is running, with no pending interrupt, because it is doing what it was asked to do. Jobs that wait for the polling job's result stay idle meanwhile, as they would behind any other job.

How often the engine looks, how it backs off and when it gives up are the implementation's own. Giving up is an ordinary node failure, so an error edge from the node catches it like any other.

Signals are where a polling run differs from a busy one. INT-5 waits for the job in flight to finish before it looks at a signal. A run that only polls has no job in flight, and the next look could be an hour away, so a pause or a cancel acts at once. However the run ends, cancelled or failed, the polling job becomes cancelled (PIPE-10): the export was already started, and skipped would say it never ran. A pause holds the polling job too: no look is made while the run is paused, and one that falls due meanwhile is made after the resume.

Example

A run that is only polling: its one open job is an export the engine checks every few minutes.

The run's jobspolling
{ "start_export": "polling", "notify": "idle" }
The run's status documentrunning
{ "id": "6918", "status": "running", "pendingInterrupt": null, "pausedReason": null }

A cancel accepted for this run ends it at once, without waiting for the next look.

The polling job after the cancelcancelled
{ "start_export": "cancelled" }

Why

Recorded under OPEN-56, OPEN-63.

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