Enhance max active runs log - #72389
Closed
yquaziii wants to merge 277 commits into
Closed
Conversation
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8. - [Release notes](https://github.com/micromatch/micromatch/releases) - [Changelog](https://github.com/micromatch/micromatch/blob/4.0.8/CHANGELOG.md) - [Commits](micromatch/micromatch@4.0.5...4.0.8) --- updated-dependencies: - dependency-name: micromatch dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> (cherry picked from commit e02052b) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(docs): add an example for auth with keycloak Added a new section in the authentication documentation that provides a code of configuring Airflow to work with Keycloak. * chore(docs): add an example for auth with keycloak Fix spelling and styling * chore(docs): add an example for auth with keycloak Fix static checks Co-authored-by: Natsu <34879762+hoalongnatsu@users.noreply.github.com>
…41829) * Fix: DAGs are not marked as stale if the AIRFLOW__CORE__DAGS_FOLDER changes * Update airflow/dag_processing/manager.py * Add testcase * Add code comment * Update code comment * Update the logic for checking the current dag_directory * Update testcases * Remove unwanted code * Uncomment code * Add processor_subdir when creating processor_subdir * Fix test_retry_still_in_executor test * Remove config from test * Update airflow/dag_processing/manager.py Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com> * Update if condition for readability --------- Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com> (cherry picked from commit 9f30a41)
…r as True. (#41834) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
…1874) Earlier PR create to address the issue was not handling the case for the Example Dags, due to which the example dags were marked as stale since they are not present in the dag_directory. This PR handles that scenarios and update the testcase accordingly. related: #41432 (cherry picked from commit 435e968)
Bumps [webpack](https://github.com/webpack/webpack) from 5.76.0 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.76.0...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit e8888fe) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update release command for Airflow 2 For airflow 2, we create a branch out of v2-10-test and sync that branch with v2-10-stable to make a release. * Update CI check
Beacause we pinned universal-pathlib to 0.2.2 in 2.10.0 adding >= 0.2.3 conflicts with currently released PyPI packages. We shoudl lower it down in order to allow PyPI constraints to not be conflicting (cherry picked from commit 351961c)
This also deprecates the public helper functions that powered it. These will all be removed in Airflow 3 in favor of `dags show`.
They are necessarily dangerous, but simply due to the way they are integrated into Airflow, their side effects can be pretty impactful. Co-authored-by: Jed Cunningham <jedcunningham@apache.org>
using logical_date as suggested.
updated to logical_date
added else to handle none scenarios
yquaziii
requested review from
Miretpl,
amoghrajesh,
ashb,
bugraoz93,
choo121600,
ephraimbuddy,
gopidesupavan,
hussein-awala,
jason810496,
jedcunningham,
jscheffl,
potiuk,
shahar1,
vatsrahul1001 and
vincbeck
as code owners
September 1, 2026 19:48
Author
|
closing this request as it took way to many commits. Kindly discard it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, when a DAG reaches its
max_active_runslimit, the scheduler logs a generic message:DAG <dag_id> is at (or above) max_active_runs (<X> of <Y>), not creating any more runsWhile this indicates that the limit has been reached, it does not provide any context about what is occupying those active slots. To figure out why the DAG is stuck, users currently have to manually navigate through the Airflow UI or query the metadata database to find the hanging runs and tasks.
This PR:
Enhances the log message in
scheduler_job_runner.py. When themax_active_runslimit is hit, the scheduler will perform targeted queries to fetch the specificrun_ids andtask_ids (along with their current states) that are holding the active slots.New Log Output Example:
DAG test_dag is at (or above) max_active_runs (1 of 1), not creating any more runs. Active Runs: scheduled__2023-10-18T09:55:00+00:00 | Active Tasks: [sleep_task in scheduled__2023-10-18T09:55:00+00:00 (running)]Implementation Note:
To avoid unnecessary database load, the queries to fetch the active runs and tasks are placed strictly inside the
if total_active_runs >= dag.max_active_runs:condition. This ensures there is zero performance overhead during normal, healthy scheduling loops.test_scheduler_job_runner.pyto ensure the logging fires with the correct format and data.Was generative AI tooling used to co-author this PR?
Generated-by Google Antigravity for checking which files to changes and test.
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.