rmfrall commented on PR #77697: URL: https://github.com/apache/airflow/pull/77697#issuecomment-7241058733
Also cc @dasarijashwanth 鈥?thanks for #77661, which covers the same area and came in earlier than this one; I only spotted it after pushing this branch. Listing the design differences here so it is easier for maintainers to compare the two. Both approaches implement the same warning/error split, so this is really only about where the retry decision is reflected: - #77661 moves the failure log into `_handle_current_task_failed` (new `log_failure` kwarg) and picks the severity from the resulting state, so the decision is made exactly once. - This PR instead keeps `_handle_current_task_failed` unchanged and consults a standalone `_will_be_retried` predicate before logging, so the decision function keeps its current log-free contract and the traceback stays where it is on `main`, before the "Post Execute" group. - Since the latest push this PR also routes handler failures through the same predicate in `_handle_handler_failure` (the terminal `AirflowFailException` / `AirflowSensorTimeout` / `AirflowTaskTerminated` classifications keep the error level), so all four failure entry points pick the severity the same way. The trade-off of the predicate route is that it has to mirror the decision logic, so it is unit-tested against every path the real decision takes (server `should_retry` with and without run context, policy RETRY / DEFAULT / FAIL / RESCHEDULE within and past bounds, and a policy that raises). The retry case of `test_task_runner_not_fail_on_failed_callback` asserts the warning/exception split, and handler-failure logging has its own warning / final-try-error / terminal-exception tests. One extra detail: non-final attempts log as "Task failed with exception, will retry" / "Task exited, will retry", so an intermediate attempt can be told apart from a final failure even where the level is not visible (e.g. filtering structured logs by message). If maintainers prefer the single-evaluation shape of #77661, I am happy to port the predicate tests onto it 鈥?or to close this one in favour of #77661 if that is simpler for everyone. -- 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]
