guide
guide9 min read

How to Tell Transient from Systemic Pipeline Failures When Airflow Retries Mask Them

Five layers that separate a blip from a defect when a retry turns the task green

A retry cannot tell you whether a failure was transient or systemic, because Airflow's default behavior is to retry a failed task with a fixed count and delay regardless of the error type, as the Airflow task documentation describes. A task that passes on attempt two looks the same on the DAG grid as a task that never failed. To separate a blip from a defect, you have to record why attempt one failed and watch whether the same reason keeps coming back.

Key Takeaways

  • •Airflow's default_task_retries is 0 and default_task_retry_delay is 300 seconds, per the Airflow configuration reference, so any retry behavior in your estate is a choice someone made per DAG or per task.
  • •A green run after a retry is evidence the task can pass, not evidence the failure was transient. Only the reason for the first failure can say that.
  • •Classify each failure by error class first (permanent, transient, ambiguous), then by whether the same class repeats across runs, tasks or days.
  • •Retries multiply across layers: the Google SRE book shows three layers of 3 retries producing 64 attempts (4^3) on the database from one user action.
  • •Use AirflowFailException for errors a retry cannot fix, and give transient errors a bounded budget with backoff, so a systemic fault fails loudly instead of quietly consuming attempts.

Why a successful retry hides the real problem

The Airflow task documentation defines the up_for_retry state as a task that failed but has retry attempts left and will be rescheduled. That state is brief. Once the next attempt succeeds, the task instance ends in success, and anyone looking at the run later sees a green box. The failure still happened. It just stopped being the headline.

A DZone article on AI-assisted Airflow failure detection makes the same point: retries can obscure whether a failure is transient or systemic. We could not load the full article from our build environment, so we are relying on the summary of that claim and not on any specific number from it. The claim itself matches how Airflow works, and it is the reason we treat a retry as a signal to log, not an outcome to celebrate.

The cost shows up slowly. A warehouse that is intermittently throttling, an upstream API that returns a malformed page one time in ten, or a schema change that breaks only certain partitions will each produce failures that a retry absorbs. Runtime creeps up, the SLA window narrows, and the first visible symptom is a late dashboard weeks later. The retries did their job on every individual run and still hid the trend.

Layer 1: Separate permanent errors from retryable ones

The cheapest classification happens at the task itself. Airflow's AirflowFailException marks the current task as failed while ignoring any remaining retry attempts, and the task documentation suggests it for cases where a retry will not help, such as an invalid API key. Raising it for authentication failures, missing required columns and malformed configuration means those errors fail on attempt one, with the real cause on top.

The inverse matters as much. Timeouts, connection resets, rate-limit responses and lock waits are the errors retries are for. Keep a short list of exception types and HTTP status classes that you consider retryable, and let everything else fail fast. Unknown errors are the awkward middle: we would retry them once, flag them as ambiguous, and make sure the first failure's message is stored somewhere that outlives the task instance.

This layer will not catch everything. A permanent defect can look transient, such as a timeout caused by a query that scans ten times the data it did last month. That is why the next layers look at patterns across runs and not at single errors.

Layer 2: Bound the retry budget and use backoff

Unbounded or generous retries are what turn a systemic fault into a long, quiet one. The Google SRE book chapter on cascading failures advises limiting retries per request, using randomized exponential backoff, and capping retries with a budget, giving the example of allowing only 60 retries per minute in a process. The same reasoning applies to a scheduler that retries hundreds of tasks against one struggling system.

Airflow gives you the per-task controls: retries, retry_delay and exponential backoff. The configuration reference lists a default of 0 retries and a 300-second delay, which means retries only exist where a DAG author added them. Audit which DAGs set them and to what. A blanket retries=5 copied from a template is a common way for a real defect to spend twenty-five minutes looking like success.

Be careful about stacking. If a task retries, the operator inside it retries, and the client library retries, the attempts multiply, as the SRE book's 64-attempt example shows. Pick one layer to own retries and turn the others down.

Layer 3: Record the first failure, not just the final state

To classify anything, you need the reason attempt one failed. The final task state will not carry it. Capture, at the moment a task enters up_for_retry, the DAG, task, run, attempt number, exception class, a normalized message and the upstream system involved. An on_retry_callback is the natural hook for writing that record to a table you control.

Normalization is what makes the record useful. Strip row counts, timestamps, hostnames and IDs from the error message so that two failures with the same cause produce the same fingerprint. Without that, every failure looks unique and nothing ever repeats. With it, a simple group-by tells you that one fingerprint accounts for most of the retries this week.

Keep the table small and boring: one row per failed attempt, with the fingerprint as the key you aggregate on. It does not need to be a platform. It needs to exist before the next incident, because Airflow's task states alone will not let you reconstruct what the retries absorbed.

Layer 4: Measure repetition across runs, tasks and time

Once failures have fingerprints, three questions separate transient from systemic. Does the same fingerprint recur across consecutive runs of one task? Does it appear across different tasks that share a source or a warehouse? Is its frequency rising? A fingerprint that appeared once in a month is almost certainly a blip. One that appears in most runs, even if each run recovers, is a defect with a retry in front of it.

  • •Same task, consecutive runs: usually a data or code defect, such as a schema change or a slow query.
  • •Different tasks, same dependency: usually the dependency, such as a warehouse queue, an API quota or a credentials rotation.
  • •One failure per run, rising slowly: usually growth, such as data volume outpacing a timeout.
  • •Clustered in a narrow time window: usually infrastructure or a maintenance event, and often truly transient.

Alert on the retry rate per fingerprint, not on failures. A task that retries and passes should never page anyone, but a fingerprint whose weekly retry count has doubled should open a ticket. That keeps the retries you want and removes the silence you do not.

Layer 5: Escalate with context, and decide who acts

Classification is only useful if something follows it. For a transient class, the action is to do nothing and keep counting. For a systemic one, someone has to trace the cause: which upstream change, which lineage path, which query. That work crosses the orchestrator, the warehouse and the catalog, and it is where the engineer usually becomes the integration layer.

This is the step where we use the Incidents Agent in Data Workers: it debugs failed pipelines, traces root cause across lineage, logs and queries, and proposes safe fixes for review. It is an MCP server, so you can ask from Claude Code or Cursor something like "Why is the nightly pipeline 3x slower this week?" and get a cause tied to the repeating fingerprint. Agents that chain with the Pipeline Agent can then propose the change, and the Orchestration Agent routes the handoffs. Writes stay behind the approval and autonomy settings you choose.

Whatever tool does it, set the escalation rule down in writing. A fingerprint seen on N runs in M days gets an owner and a ticket. A permanent-class failure pages immediately. Everything else stays in the table, counted and unremarkable.

Frequently Asked Questions

Should I turn retries off to see real failures?

Not usually. Retries are the right answer to genuinely transient errors, and removing them trades noise for pages that do nothing. Keep them, bound them, and record the first failure. The goal is to keep the recovery while preserving the evidence. The Airflow configuration reference shows retries default to 0, so you only have them where someone chose to add them. Review those choices rather than removing them wholesale.

How many retries are too many?

There is no universal number, and we would not quote one. The Google SRE book treats an unbounded retry loop as a hazard and recommends per-request limits plus a budget. In an orchestrator, a practical rule is to size retries to the longest outage you consider a blip, then check whether the retry rate per fingerprint is flat. If a task needs its last attempt regularly, treat it as failing.

Can an agent tell the difference automatically?

An agent can do the mechanical parts well: fingerprinting errors, counting repeats, correlating them with upstream changes and drafting a root cause. It cannot know your tolerance for risk, so the decision about what to fix and who approves it should stay with your team. Verify any agent's diagnosis against the logs and lineage it cites before acting on it, and treat an unsupported diagnosis as a hypothesis.