hussein-awala opened a new pull request, #72850: URL: https://github.com/apache/airflow/pull/72850
Tasks that raise `AirflowFailException`, `AirflowSensorTimeout`, or `AirflowTaskTerminated`, and tasks whose retry policy returns `FAIL`, report a failed state but omit `ti_failures` and `operator_failures`. Non-retryable exceptions raised inside outcome handlers have the same gap. Record the failure counters once in `run()` after the final outcome is known, for both `FAILED` and `UP_FOR_RETRY`. This restores emission through the shared metrics facade for StatsD and OpenTelemetry, including the registry-derived legacy operator counter. It also removes the per-instance deduplication flag: retry-handler recovery can run twice, but the final outcome is counted once. Retry decisions and terminal-state messages are unchanged. Validation: - Nine regression cases fail without the production change and pass with it. Coverage includes forced failure, sensor timeout, termination, retry-policy `FAIL`, both retry eligibility settings, and a non-retryable exception raised inside an outcome handler. - All 543 task-runner tests pass, including the existing retry-handler double-fault and once-only counter tests. - Ruff, Task SDK mypy, and both required prek stages pass. - The broader Task SDK suite is running with two workers after a four-worker run hit worker crashes in the local Docker environment (about 2 GB RAM). The separate queued-duration P1 is already covered by #67592 and is outside this PR. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex (GPT-6) Generated-by: Codex (GPT-6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: Codex (GPT-6) (no human review before posting) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
