Repository navigation
Commit 08d8d0c
committed
Run loop gates and advance iterations atomically
The scheduler, the API and the UI must never see every task of a loop finished
while its next pass does not exist yet. If we recorded a continuing gate
as successful and created the next pass afterwards, a crash between the two
would leave recovery unable to tell an unfinished advancement from a completed
decision. Gate completion and next-pass creation therefore happen in one
transaction under the DagRun lock, which also stops a duplicate completion from
advancing the loop twice.
The continue-or-stop decision is a reserved XCom stored under the gate's attempt
UUID. A retried gate starts without a decision, and a retired attempt cannot
advance the loop. An invalid decision moves the gate attempt to retry or failed
within the same request; rejecting the request instead would leave the attempt
running with nobody to finish it.
Gates use normal task dependencies and an explicit loop context. A barrier
that waited for every body task would override trigger rules that allow early
progress. Workers and dag.test supply the same coordinates, so decisions and
previous-iteration reads reach the intended gate and data.
Skipping downstream of a task from outside a loop skips every live pass.
Skipping only one would let later passes run work the author meant to skip.1 parent c3b6ed7 commit 08d8d0c
50 files changed
Lines changed: 3094 additions & 186 deletions
File tree
- airflow-core
- docs/authoring-and-scheduling
- src/airflow
- api_fastapi/execution_api
- datamodels
- routes
- versions
- example_dags
- jobs
- models
- serialization/definitions
- ti_deps
- tests/unit
- api_fastapi/execution_api/versions
- head
- v2026_10_30
- jobs
- models
- ti_deps/deps
- devel-common/src/tests_common/test_utils
- go-sdk
- pkg/execution/genmodels
- schema
- scripts/ci/prek
- task-sdk
- src/airflow/sdk
- api
- datamodels
- bases
- definitions
- _internal
- decorators
- execution_time
- schema
- versions
- tests/task_sdk
- definitions
- _internal
- decorators
- execution_time
- schema
- ts-sdk
- schema
- src/generated
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
424 | 434 | | |
425 | 435 | | |
426 | 436 | | |
427 | 437 | | |
428 | 438 | | |
429 | 439 | | |
| 440 | + | |
| 441 | + | |
430 | 442 | | |
431 | 443 | | |
432 | 444 | | |
| |||
Lines changed: 94 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| 181 | + | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
| |||
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
338 | 354 | | |
339 | 355 | | |
340 | 356 | | |
| |||
434 | 450 | | |
435 | 451 | | |
436 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
437 | 482 | | |
438 | 483 | | |
439 | 484 | | |
| |||
521 | 566 | | |
522 | 567 | | |
523 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
524 | 588 | | |
525 | 589 | | |
526 | 590 | | |
| |||
544 | 608 | | |
545 | 609 | | |
546 | 610 | | |
| 611 | + | |
| 612 | + | |
547 | 613 | | |
548 | 614 | | |
549 | 615 | | |
| |||
594 | 660 | | |
595 | 661 | | |
596 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
597 | 666 | | |
598 | 667 | | |
599 | 668 | | |
| |||
627 | 696 | | |
628 | 697 | | |
629 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
630 | 708 | | |
631 | 709 | | |
632 | 710 | | |
| |||
939 | 1017 | | |
940 | 1018 | | |
941 | 1019 | | |
942 | | - | |
943 | | - | |
| 1020 | + | |
| 1021 | + | |
944 | 1022 | | |
945 | 1023 | | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
| 1024 | + | |
950 | 1025 | | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
959 | 1032 | | |
960 | 1033 | | |
961 | 1034 | | |
962 | 1035 | | |
963 | 1036 | | |
964 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
965 | 1041 | | |
966 | 1042 | | |
967 | 1043 | | |
| |||
979 | 1055 | | |
980 | 1056 | | |
981 | 1057 | | |
| 1058 | + | |
982 | 1059 | | |
983 | 1060 | | |
984 | 1061 | | |
| |||
0 commit comments