Skip to content

fix(scheduler): don't skip asset-triggered dag runs when use_job_schedule is False#62931

Open
YoannAbriel wants to merge 2 commits intoapache:mainfrom
YoannAbriel:fix/issue-62929
Open

fix(scheduler): don't skip asset-triggered dag runs when use_job_schedule is False#62931
YoannAbriel wants to merge 2 commits intoapache:mainfrom
YoannAbriel:fix/issue-62929

Conversation

@YoannAbriel
Copy link
Contributor

Problem

use_job_schedule=False disables both time-based and asset-based scheduling. The config is documented as only affecting cron interval scheduling, but asset-triggered DAGs also stop getting scheduled.

Root Cause

In SchedulerJobRunner._do_scheduling_loop, the entire _create_dagruns_for_dags call is gated behind use_job_schedule. That method handles both time-based and asset-triggered dag run creation, so setting the flag to False skips everything.

Fix

Moved the use_job_schedule check inside _create_dagruns_for_dags so it only gates _create_dag_runs (time-based). Asset-triggered and partitioned asset dag runs are always processed regardless of the setting.

Added two tests verifying that with use_job_schedule=False:

  • Asset-triggered dag runs are still created
  • Time-based dag runs are not created

Closes: #62929


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

Generated-by: Claude Code following the guidelines


  • 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.

@YoannAbriel YoannAbriel requested review from XD-DENG and ashb as code owners March 5, 2026 11:15
@boring-cyborg boring-cyborg bot added the area:Scheduler including HA (high availability) scheduler label Mar 5, 2026
@YoannAbriel YoannAbriel force-pushed the fix/issue-62929 branch 4 times, most recently from 8230a17 to f7c14e4 Compare March 5, 2026 19:02
…dule is False

When use_job_schedule=False, asset-triggered dag runs and partitioned
asset dag runs were incorrectly skipped along with time-based scheduling.

The fix moves the use_job_schedule check inside _create_dagruns_for_dags
so that only time-based (cron/interval) dag run creation is skipped,
while asset-triggered dag runs are always created.

Fixes apache#62929

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use_job_schedule affects asset based scheduling

1 participant