Consume every queued asset event from concurrent mapped outlets - #71997
Open
Vamsi-klu wants to merge 2 commits into
Open
Consume every queued asset event from concurrent mapped outlets#71997Vamsi-klu wants to merge 2 commits into
Vamsi-klu wants to merge 2 commits into
Conversation
apache#70972 already consumes queued asset events by id, so concurrent mapped outlets no longer strand events behind a timestamp watermark. These tests lock that contract for mapped producers so a later consume-path change cannot silently drop events from triggering_asset_events. closes: apache#54659
The same-timestamp and AND cases only pinned consume if events were already queued by hand. Running mapped TIs through register/queue keeps those pins on the user path, including alias context lookup. closes: apache#54659
Contributor
Author
|
cc @uranusjr @ashb @XD-DENG mapped outlet consume-all coverage on the scheduler path. Drafted-by: Cursor Grok 4.6; reviewed by @Vamsi-klu before posting |
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.
Consume every queued asset event from concurrent mapped outlets
closes: #54659
What I did
Tests only. Mapped producer
@task(outlets=[asset]).expand(...)succeeds, then one scheduler tick. Assert all N events land on the consumer run and intriggering_asset_events. No production change. No newsfragment.Why I did
Three mapped outlets were finishing together and the consumer only saw a subset in
triggering_asset_events. Consume-by-event-id is already on main. Existing tests still insert ADRQ by hand, so they never covered this emit path.How I did
Emit:
dag_maker.run_ti(..., map_index=N)→register_asset_changes_in_db.Consume:
SchedulerJobRunner._create_dagruns_for_dags.Context:
get_template_contextafter loadingconsumed_asset_events.One tick batches all visible events. That is the default, not a bug. Leftovers stay for the next tick.
What's the impact
None at runtime. If the mapped emit path regresses, these tests fail instead of silently dropping events.
What's the testing
airflow-core/tests/unit/jobs/test_scheduler_job.pytest_mapped_outlet_asset_events_consumed_in_one_ticktest_mapped_outlet_asset_events_consumed_across_staggered_tickstest_mapped_outlet_asset_events_same_timestamp_are_all_consumedtest_mapped_outlet_asset_events_and_condition_waits_for_all_assetstest_mapped_outlet_asset_alias_events_are_all_consumedWas generative AI tooling used to co-author this PR?
Generated-by: Grok 4.6 following the guidelines