Dead letter
A dead letter is a message or request that failed. Instead of dropping it, the system sets it aside in a dead letter queue, where a later retry or a person can deal with it. The pipeline keeps running, and the failure stays on record.
In BlockJuice
In BlockJuice a dead letter is a failed call, kept in the warehouse so a later run can make it again. Only a call source has them. A call source makes calls, such as an RPC read at one block. A failed call does not fail the run. The run writes the records that did arrive, and the failed calls wait in raw._dead_letters.
A dead letter is pending or parked. The next run retries every pending one next to its new calls, and a record from the retried call clears it. A run parks a dead letter once its call has failed five times, or when the call no longer parses with the source’s call schema. No run retries a parked dead letter. It waits for a person.
Each run records the pending and parked dead letters it leaves in ops.ingestion_runs, and Prometheus raises an alert when any are parked. bj answer checks every input for dead letters before it gives a value.
A stream source has no dead letters, because it makes no calls. An error fails its run, and the next run resumes after the last batch that committed.
Example
To see what waits for a person, read the parked dead letters and their last error.
select source_table, id, attempts, error, last_failed_at
from raw._dead_letters
where parked
order by last_failed_at desc