Skip to content

Fix use_job_schedule=False disabling asset-triggered Dag runs - #67764

Closed
Vamsi-klu wants to merge 9 commits into
apache:mainfrom
Vamsi-klu:fix/62929-use-job-schedule-asset-runs
Closed

Vamsi-klu wants to merge 9 commits into
apache:mainfrom
Vamsi-klu:fix/62929-use-job-schedule-asset-runs

Conversation

@Vamsi-klu

@Vamsi-klu Vamsi-klu commented May 30, 2026 •

Copy link
Copy Markdown

What is the change?

[scheduler] use_job_schedule=False now disables only time-based (cron/timetable) scheduling. Asset-triggered and partitioned-asset-triggered Dag runs are still created, as are manual runs.

Why did I do it?

The flag gated the entire _create_dagruns_for_dags call in _do_scheduling, but that method also creates asset-triggered and partitioned-asset runs. Setting the flag to False silently stopped all asset-driven scheduling, contradicting the documented behavior. This supersedes #62931, which was closed for author inactivity; the approach itself was never disputed.

closes: #62929

How did I do it?

I moved the flag check inside _create_dagruns_for_dags so it wraps only the time-based _create_dag_runs(non_asset_dags, ...) call. The orchestrator, and with it the asset and partition paths, always runs. I also fixed the "Disable the scheduler" maintenance doc, which claimed the flag stops all new Dag runs, and pointed readers at dags pause for a full stop.

What's the impact?

Deployments that turn off cron scheduling keep their event- and data-driven pipelines. No behavior change with the flag at its default True.

What's the test plan?

Three regression tests in test_scheduler_job.py, each verified to fail on the unfixed code: an asset-triggered run created with the flag off, a partitioned-asset run created with the flag off, and a flag-on companion proving cron runs are still gated. The full scheduler suite, the exact-query-count tests, mypy, and the static checks passed.


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

Generated-by: Claude Code (Opus 4.8) following the guidelines

@Vamsi-klu

This comment was marked as spam.

Comment thread airflow-core/newsfragments/67764.bugfix.rst Outdated
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jun 1, 2026
@potiuk potiuk removed the ready for maintainer review Set after triaging when all criteria pass. label Jul 18, 2026
@Vamsi-klu

This comment was marked as spam.

@Vamsi-klu

This comment was marked as spam.

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 20, 2026
@Vamsi-klu

This comment was marked as spam.

Comment thread airflow-core/src/airflow/jobs/scheduler_job_runner.py Outdated
@cursor
cursor Bot force-pushed the fix/62929-use-job-schedule-asset-runs branch from 486cb0f to 900e7ab Compare August 19, 2026 01:14

@Pedrinhonitz Pedrinhonitz 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.

That works for me; the process can proceed to the maintainer's review, where the impact will be assessed more precisely.

Vamsi-klu and others added 8 commits August 24, 2026 00:19
[scheduler] use_job_schedule is documented to turn off only cron/time-based
scheduling, but it gated the entire _create_dagruns_for_dags call, which also
creates asset- and partitioned-asset-triggered runs. As a result, setting the
flag to False silently stopped all asset-driven scheduling.

Move the flag check so it gates only time-based run creation; asset- and
partition-triggered runs are now always created, matching the documented
behavior. Also update the "Disable the scheduler" maintenance docs, which
previously claimed this flag stops all new Dag runs.

closes: apache#62929
Align the asset-triggered setup with current catchup/backlog gating
(apache#39456): create the consumer before events and place AssetEvent /
AssetDagRunQueue timestamps inside the consumer's schedule window so
consumed_asset_events is populated under catchup=False.
The same rationale was stated verbatim at both call sites, which review
feedback flagged as too verbose. Keep one concise note at the actual gate.
AssetDagRunQueue now requires asset_event_id, so the use_job_schedule
regression test was failing Serialization DB CI with a NOT NULL
IntegrityError instead of exercising the scheduler flag.
AssetDagRunQueue now requires asset_event_id, so the use_job_schedule
regression must persist the event before queueing or Serialization CI
fails with a NOT NULL IntegrityError instead of testing the flag.
Fork workflows were waiting on approval after a bot push.
@cursor
cursor Bot force-pushed the fix/62929-use-job-schedule-asset-runs branch from 7888fec to f66a5e9 Compare August 24, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use_job_schedule affects asset based scheduling

6 participants