Skip to content

Improve the log file template for ExecuteCallback - #62616

Merged
ferruzzi merged 1 commit into
apache:mainfrom
henry3260:Improve-executor-callback-log-file-template
Mar 10, 2026
Merged

ferruzzi merged 1 commit into
apache:mainfrom
henry3260:Improve-executor-callback-log-file-template

Conversation

@henry3260

@henry3260 henry3260 commented Feb 28, 2026 •

Copy link
Copy Markdown
Member

Why

Currently, all executor callback logs are stored in a single flat directory executor_callbacks/, named only by their callback ID. This makes it difficult to associate logs with specific DAGs or runs without querying the database.

closes: #60464

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @ferruzzi ?

@ferruzzi

ferruzzi commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for doing this. You are way out of date on your working branch, that file no longer exists. But the same change would be in airflow-core/src/airflow/executors/workloads/callback.py

As far as the change itself, I think it should be alright. Just to think this through, there is currently a PR up that will be adding TestConnection workloads to the executor, and likely in the near future we'll be migrating on_success_callback, on_failure_callback, etc over to the ExecutorCallback framework. I think this still makes sense for the on_foo_callback; those are either be assigned to a Dag or a task, so either way it'll have this info, so those should be fine.

And the TestConnection doesn't go through the callback flow so that should be fine too.

Update your branch and make the change in the right/new location and ping me for a re-review, I'll approve it.

@henry3260
henry3260 force-pushed the Improve-executor-callback-log-file-template branch from 665cafa to 1052dea Compare March 7, 2026 07:02
Copilot AI review requested due to automatic review settings March 7, 2026 07:02
@henry3260

Copy link
Copy Markdown
Member Author

Thanks for doing this. You are way out of date on your working branch, that file no longer exists. But the same change would be in airflow-core/src/airflow/executors/workloads/callback.py

As far as the change itself, I think it should be alright. Just to think this through, there is currently a PR up that will be adding TestConnection workloads to the executor, and likely in the near future we'll be migrating on_success_callback, on_failure_callback, etc over to the ExecutorCallback framework. I think this still makes sense for the on_foo_callback; those are either be assigned to a Dag or a task, so either way it'll have this info, so those should be fine.

And the TestConnection doesn't go through the callback flow so that should be fine too.

Update your branch and make the change in the right/new location and ping me for a re-review, I'll approve it.

Thanks for your information!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves how executor callback logs are organized by switching from a flat log filename (keyed only by callback ID) to a hierarchical path that includes the DAG and DagRun identifiers, making it easier to locate logs without additional DB lookups.

Changes:

  • Update ExecuteCallback.make() to set log_path as executor_callbacks/{dag_id}/{run_id}/{callback_id}.

You can also share your feedback on Copilot code review. Take the survey.

@henry3260

Copy link
Copy Markdown
Member Author

cc @ferruzzi

@ferruzzi
ferruzzi merged commit 7152b2a into apache:main Mar 10, 2026
76 of 77 checks passed
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
Pyasma pushed a commit to Pyasma/airflow that referenced this pull request Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Executors-core LocalExecutor & SequentialExecutor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve executor callback log file template

5 participants