Skip to content

Detector catalog / Reliability

FAIL

Failed tasks

Tasks fail and run again, so the cluster pays for the same work twice.

Outcome
Reliability
Scope
Judged per stage
Usual fix
A change in the job code
CI gate
Budget flag --max-failed-task-rate

An example finding

Where you see it

Dashboard

The FAIL tag marks it in the action region of the dashboard, among the widgets that rank a fix. Every affected stage is flagged, not only the worst.How to read it in the findings guide.

Agent (MCP)

An assistant can read this entry with the list_detectors tool and its background with get_finding_documentation. The call and the response below come from a real run of the MCP server.

Call

{
  "tool": "list_detectors",
  "arguments": {
    "type": "failures"
  }
}

Response

{
  "count": 1,
  "detectors": [
    {
      "type": "failures",
      "name": "failed tasks",
      "tag": "FAIL",
      "tagSharedWith": [],
      "family": "reliability",
      "pitch": "Tasks fail and run again, so the cluster pays for the same work twice.",
      "region": "action",
      "scope": "stage",
      "fixEffort": "code",
      "thresholdSummary": "over 5% of a stage's tasks failing",
      "detectors": [
        {
          "detector": "failures",
          "version": 2,
          "thresholds": {
            "minTasks": 10,
            "warnRate": 0.05,
            "critRate": 0.2
          }
        }
      ],
      "pages": {
        "catalog": "docs/detectors/failures.html",
        "guide": "docs/user-guide/understanding-findings.html#fail"
      },
      "tuning": {
        "kind": "shared",
        "anchor": "#bottleneck-failures",
        "path": "docs/tuning-reference/bottleneck-failures.html#bottleneck-failures"
      },
      "gate": {
        "cliFlag": "--max-failed-task-rate",
        "airflowParam": "max_failed_task_rate_pct"
      }
    }
  ]
}

get_finding_documentation call

{
  "tool": "get_finding_documentation",
  "arguments": {
    "type": "failures"
  }
}

Its response, with each Markdown body replaced by its length

{
  "type": "failures",
  "name": "Failed Tasks",
  "detectionDoc": {
    "tag": "FAIL",
    "title": "Failed tasks",
    "content": "<879 characters of Markdown>"
  },
  "tuningDoc": {
    "anchor": "#bottleneck-failures",
    "title": "Task Failures",
    "content": "<7414 characters of Markdown>"
  }
}

CI (CLI)

List this entry from the command line. The output below is a real run of the command. Budgets and exit codes are in the CI guide.

sparkforensics-analyze detectors --type failures --format md
# Detectors (1)

## Reliability

| Tag | Type | Scope | Fix | Gate | What it finds |
| --- | --- | --- | --- | --- | --- |
| FAIL | `failures` | stage | code | `--max-failed-task-rate` | Tasks fail and run again, so the cluster pays for the same work twice. |

Report only this finding type for a run with --type:

sparkforensics-analyze <event-log> --type failures --impact critical,warning,info

Fail the build when the run breaches a budget for it:

sparkforensics-analyze <event-log> --max-failed-task-rate <n>

Airflow

The operator takes the budget as the max_failed_task_rate_pct parameter.

check_spark_job = SparkForensicsOperator(
    task_id="check_spark_job",
    log_source=...,
    backend=SubprocessAnalyzeHook(),
    max_failed_task_rate_pct=...,  # your budget
)

The operator works per run, and its summary counts findings per impact band. See the operator for its parameters.

How it is measured

Thresholds

Over 5% of a stage's tasks failing.

failures version 2

ThresholdDefault
minTasks10
warnRate0.05
critRate0.2

Each rule's impact bands and fixed fallbacks are in the threshold tables.

Override a default per run with --thresholds; see Tuning detector thresholds.

Docs