Skip to content

Add task log message when the Execution API is unreachable - #70290

Merged
kaxil merged 4 commits into
apache:mainfrom
karenhsieh75:fix-empty-log-on-connection-error
Oct 12, 2026
Merged

kaxil merged 4 commits into
apache:mainfrom
karenhsieh75:fix-empty-log-on-connection-error

Conversation

@karenhsieh75

Copy link
Copy Markdown
Contributor

Why

A supervisor connection failure to the Execution API only showed up in the executor's stdout. As a result, UI users only saw a failed task with an empty log, making it difficult to identify the root cause.

How

  • Catch httpx.RequestError in supervise_task and log the failure (with the relevant config to check) to the task's own log before re-raising
  • Add a test covering the new log message

related: #51163


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 5)

Generated-by: Claude Code (Sonnet 5) following the guidelines

@boring-cyborg

boring-cyborg Bot commented Jul 23, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@karenhsieh75
karenhsieh75 force-pushed the fix-empty-log-on-connection-error branch from 9b28bfd to 644b1b2 Compare August 2, 2026 05:07
@karenhsieh75

Copy link
Copy Markdown
Contributor Author

@guan404ming Could you please help review this? Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 17, 2026
@guan404ming

Copy link
Copy Markdown
Member

I think we could remove those inline code comments here, thanks!

@guan404ming
guan404ming force-pushed the fix-empty-log-on-connection-error branch from 644b1b2 to 64c7ecb Compare September 30, 2026 12:41
kaxil added 3 commits October 8, 2026 22:25
Resolve the conflict in supervise_task by keeping both handlers: the
TaskLaunchError handler added on main, then this branch's
httpx.RequestError handler.
Drop the inline comments in the httpx.RequestError handler, as asked in
review, and give the test's coordinator, logger and log file mocks a
spec or autospec.
Write the task log to a temporary folder and read it back, as the
launch-failure tests do, instead of mocking _configure_logging. The
test now also checks that the group is closed before the error.
@kaxil kaxil removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Oct 8, 2026
@kaxil kaxil added this to the Airflow 3.4.0 milestone Oct 8, 2026
@kaxil
kaxil merged commit 7f0d50c into apache:main Oct 12, 2026
108 checks passed
@boring-cyborg

boring-cyborg Bot commented Oct 12, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants