rmfrall opened a new pull request, #77697:
URL: https://github.com/apache/airflow/pull/77697

   Every failed attempt of a retrying task was logged at error level, so
   error-based alerting (e.g. Sentry on managed deployments) fired for attempts
   that were going to be retried anyway, and a single flaky task with many 
retries
   could flood the alerting over hundreds of DAG runs.
   
   Failures that the standard failure handling will follow with another attempt 
are
   now logged as warnings, and only the final attempt keeps the error level:
   
       WARNING Task failed with exception, will retry  (+ traceback)
       ERROR   Task failed with exception               (final attempt only)
   
   Which of the two applies is decided by `_will_be_retried`, a small predicate
   mirroring the retry decision of `_handle_current_task_failed` (retry policy
   FAIL/RETRY/RESCHEDULE outcomes, the reschedule bounds, and the server-side
   `should_retry` fallback) without its logging side effects, so the logged
   severity always matches what actually happens to the task. `SystemExit` 
failures
   get the same treatment for their exit-code message. Failures that cannot be
   retried, policy-driven failures and everything routed through the
   no-retry handlers keep the current error level.
   
   closes: #32246
   
   Tests: `TestWillBeRetried` unit-tests the predicate across server decisions,
   policy outcomes (RETRY/DEFAULT/FAIL/RESCHEDULE within and past bounds, broken
   policy) and the no-run-context case; 
`test_task_runner_not_fail_on_failed_callback`
   now also asserts the retry path logs a warning while the failure path keeps
   logging an error.
   
   Note: no newsfragment added - the log-level change looked like a candidate, 
but
   per the guidelines this is not a behavior change users must read before
   upgrading (task-sdk changes are listed in the Airflow release notes; happy to
   add a `significant` fragment if maintainers disagree).
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — TeleAgent
   
   Generated-by: TeleAgent following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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]

Reply via email to