Skip to content

Failures are paced and stay visible

Accepted. Built for the ingestor runtime and function host.

2026-11-02 (design document added to the repository on that date).

The ingestor polls external systems (SFTP, S3, SQS, databases, HTTP APIs, extension sources) and hosts functions. An audit found places where a failing source or a failing platform produced a tight retry loop: an SQS receive that re-polled about ten times a second with two stack traces each, every pending payload re-posted to a platform that was down, a move or delete failing after a good read so the same file was read and sent on every poll while the source still counted as healthy, a function writing unbounded log lines, and refused credentials retried every thirty seconds for ever.

None of these lose data. They do two other kinds of harm. They hammer a system that is already struggling, and they generate log volume fast enough to become a cost problem of its own. The request that started the work was to make sure that an error on any exchange never turns into a tight loop that fills the logs.

A failure that repeats is paced, and it is logged once in full, then summarised. Nothing gives up silently: the failure stays visible on the platform the whole time, and the first success ends the streak and says so. Nothing in this decision changes what is delivered or how often a working source runs.

Two shared building blocks carry it, and new code must use them rather than write another backoff or rate-limited logger:

Block Behaviour
Backoff After failure n in a row, wait initial * 2^(n-1) up to a cap, with equal jitter (between half and the whole delay). Never shorter than a floor such as the source’s normal interval. FAILURES runs from 5 seconds to 5 minutes; REFUSED_LOGIN from 5 minutes to 1 hour.
FailureLog The first failure of a streak is logged with its stack trace; after that at most one line a minute per key, with a count (“N more like it not logged”). recovered ends the streak and reports its length.

The rules that follow from them:

  • Every polled source backs off on failures in a row. A failure is a failed poll, a failed dispatch, or a failed commit after the read. The first success returns the source to its normal interval.
  • A platform that is not taking jobs holds every ingestion. A runtime-wide breaker opens on platform-side failures (connection errors, timeouts, 5xx, 429, authorisation still refused after a token refresh), honours Retry-After up to 15 minutes, and fails submissions at once without calling the platform. The first submission after the hold is a probe. A per-ingestion refusal, such as a paused target, does not open it.
  • A failed commit is a failure. If a payload was read and sent but could not be moved, deleted or marked, the ingestion is reported as failing and paced, with a message saying it will be read again.
  • Function hosts have a log budget. Each function gets a token bucket (100 lines a second, burst 1,000 by default) and long messages are cut. Overflow is counted and reported as one summary line a minute.
  • A refused login or runner registration backs off for minutes to an hour, and the message names the cause.
  • A failed secret reveal is remembered for 10 seconds so a secrets outage does not become a request-per-call storm.

Out of scope by design: changing what is retried, and any give-up that drops data.

Good:

  • A broken source or a down platform costs a bounded number of log lines and calls, however many ingestions are configured.
  • The failure is still visible: it is on the ingestion’s health and failures list for as long as it lasts, and the streak count tells an operator how long.
  • The behaviour is the same for built-in sources, extensions and functions, because they share the two blocks.

Bad:

  • A source that recovers waits out the current backoff before its next attempt, up to five minutes (an hour for refused logins).
  • Camel components that log failures themselves needed their loggers turned down or routed, which is a list to maintain when a component is upgraded. A few repeated lines that are not copies of a reported failure remain.
  • The blocks live in the ingestor extension library. The Go services use their own, separate retry paths.
Alternative Why not
A fixed retry delay Does not protect a struggling system and still logs at a steady rate.
Give up after N failures Drops data or leaves a source silently dead. Rejected as a principle.
Rely on log sampling in the log pipeline The cost and the stack traces are produced before the pipeline sees them, and the summary count is lost.
A per-component configuration for each source Operators would have to find and set it; the pacing is a runtime property, not a user setting.