Repository navigation
[v3-4-test] Fix dynamically mapped tasks never running on scheduled Dag runs (#74861) - #74918
Merged
Merged
Conversation
…ag runs (#74861) DynamicRegion.get_or_create_many() uses a SAVEPOINT (session.begin_nested()) to safely insert dynamic-mapping regions. Releasing that SAVEPOINT dispatches the same before_commit event as a real commit, and the scheduler's CommitProhibitorGuard rejected it unconditionally, raising "UNEXPECTED COMMIT - THIS WILL BREAK HA LOCKS!" before the Dag run's task instances could be created. This only happened for a Dag run the scheduler created from its own schedule: the API server's Dag run creation runs outside the scheduler's guarded session, so the identical SAVEPOINT release there was harmless. A dynamically mapped task on a real (non-manually-triggered) schedule could therefore never run, with the same scheduling error repeating every loop. Releasing a savepoint ends neither the outer transaction nor its row locks, so it cannot break the HA locks this guard protects -- only the outer commit can, and that remains guarded. (cherry picked from commit f5038e6) Co-authored-by: Rahul Vats <[email protected]>
vatsrahul1001
approved these changes
Oct 18, 2026
vatsrahul1001
added a commit
that referenced
this pull request
Oct 20, 2026
…ag runs (#74861) (#74918) DynamicRegion.get_or_create_many() uses a SAVEPOINT (session.begin_nested()) to safely insert dynamic-mapping regions. Releasing that SAVEPOINT dispatches the same before_commit event as a real commit, and the scheduler's CommitProhibitorGuard rejected it unconditionally, raising "UNEXPECTED COMMIT - THIS WILL BREAK HA LOCKS!" before the Dag run's task instances could be created. This only happened for a Dag run the scheduler created from its own schedule: the API server's Dag run creation runs outside the scheduler's guarded session, so the identical SAVEPOINT release there was harmless. A dynamically mapped task on a real (non-manually-triggered) schedule could therefore never run, with the same scheduling error repeating every loop. Releasing a savepoint ends neither the outer transaction nor its row locks, so it cannot break the HA locks this guard protects -- only the outer commit can, and that remains guarded. (cherry picked from commit f5038e6) Co-authored-by: Rahul Vats <[email protected]>
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.
DynamicRegion.get_or_create_many() uses a SAVEPOINT (session.begin_nested())
to safely insert dynamic-mapping regions. Releasing that SAVEPOINT dispatches
the same before_commit event as a real commit, and the scheduler's
CommitProhibitorGuard rejected it unconditionally, raising "UNEXPECTED
COMMIT - THIS WILL BREAK HA LOCKS!" before the Dag run's task instances
could be created.
This only happened for a Dag run the scheduler created from its own
schedule: the API server's Dag run creation runs outside the scheduler's
guarded session, so the identical SAVEPOINT release there was harmless. A
dynamically mapped task on a real (non-manually-triggered) schedule could
therefore never run, with the same scheduling error repeating every loop.
Releasing a savepoint ends neither the outer transaction nor its row locks,
so it cannot break the HA locks this guard protects -- only the outer
commit can, and that remains guarded.
(cherry picked from commit f5038e6)
Co-authored-by: Rahul Vats [email protected]