Skip to content

Detector catalog / Speed

STRAG

Straggling task

A few tasks run far longer than their peers, and the stage waits for them.

Outcome
Speed
Scope
Judged per stage
Usual fix
A change in the job code
CI gate
No budget flag: gate it with --fail-on-introduced against a baseline

An example finding

Where you see it

Dashboard

The STRAG 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": "straggler"
  }
}

Response

{
  "count": 1,
  "detectors": [
    {
      "type": "straggler",
      "name": "straggling task",
      "tag": "STRAG",
      "tagSharedWith": [],
      "family": "speed",
      "pitch": "A few tasks run far longer than their peers, and the stage waits for them.",
      "region": "action",
      "scope": "stage",
      "fixEffort": "code",
      "thresholdSummary": "one or more tasks finishing far after the rest of their stage, for a reason other than reading more data",
      "detectors": [
        {
          "detector": "straggler",
          "version": 1,
          "thresholds": {
            "minTasks": 10,
            "shareWarn": 0.05,
            "shareWarnAtFloor": 0.025,
            "warnPct": 0.1,
            "critPct": 0.2,
            "floorPctWarn": 0.005,
            "floorPctCrit": 0.02
          }
        }
      ],
      "pages": {
        "catalog": "docs/detectors/straggler.html",
        "guide": "docs/user-guide/understanding-findings.html#strag"
      },
      "tuning": {
        "kind": "page",
        "anchor": "#bottleneck-straggler",
        "path": "docs/tuning-reference/bottleneck-straggler.html#bottleneck-straggler"
      },
      "gate": null
    }
  ]
}

get_finding_documentation call

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

Its response, with each Markdown body replaced by its length

{
  "type": "straggler",
  "name": "Straggling Task",
  "detectionDoc": {
    "tag": "STRAG",
    "title": "Straggler tasks",
    "content": "<1659 characters of Markdown>"
  },
  "tuningDoc": {
    "anchor": "#bottleneck-straggler",
    "title": "Stragglers",
    "content": "<7783 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 straggler --format md
# Detectors (1)

## Speed

| Tag | Type | Scope | Fix | Gate | What it finds |
| --- | --- | --- | --- | --- | --- |
| STRAG | `straggler` | stage | code |  | A few tasks run far longer than their peers, and the stage waits for them. |

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

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

It has no budget flag. Fail a build on a new one by comparing against a baseline with --fail-on-introduced.

Airflow

The operator has no budget parameter for it. Use fail_on_introduced with a baseline.

check_spark_job = SparkForensicsOperator(
    task_id="check_spark_job",
    log_source=...,
    backend=SubprocessAnalyzeHook(),
    baseline_log_source=...,
    fail_on_introduced="critical",
)

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

How it is measured

Thresholds

One or more tasks finishing far after the rest of their stage, for a reason other than reading more data.

straggler version 1

ThresholdDefault
minTasks10
shareWarn0.05
shareWarnAtFloor0.025
warnPct0.1
critPct0.2
floorPctWarn0.005
floorPctCrit0.02

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