JH0917 opened a new pull request, #73933:
URL: https://github.com/apache/airflow/pull/73933

   Since 3.3.1 (#69933), Grid and Graph return HTTP 500 when TaskGroups wait on 
each other as
   units, even though the task graph is acyclic. A path that leaves a group and 
re-enters it
   (`g.a >> ext >> g.b`) is enough, and `partial_subset` filtering can create 
the same shape
   (found by @shubhamraj-git in #73678), so the UI sort must tolerate it.
   
   **Changes:**
   
   1. When all remaining children are blocked, pass numbering releases one 
child on the cycle
      and continues. The sweep path falls back to pass numbering instead of 
raising.
   2. Dags without a group-level cycle are sorted exactly as before. The 
task-sdk sort still raises.
   
   **vs #73724:** same bug, different approach. #73724 collapses each SCC into 
one unit; this
   breaks the cycle at a single child inside the existing loop, with no new 
helpers, and puts
   fewer dependencies out of order (ring of three groups: 1 vs 2).
   
   <details>
   <summary>Benchmark and randomized check</summary>
   
   Root-level `topological_sort`, best of 3:
   
   | Dag shape | children | this PR | #73724 |
   |---|---|---|---|
   | acyclic chain | 10,000 | 5.6 ms | 5.6 ms |
   | 5,000 `g.a >> bridge >> g.b` cycles | 10,000 | 22.2 ms | 24.2 ms |
   | reverse-declared chain behind one cycle | 10,002 | 13.2 ms | 20.8 ms |
   | 5,000-task chain behind 2,000 cycles | 9,000 | 37.3 ms | 20.8 ms |
   
   3,000 random Dags: groups without a group-level cycle (11,504) sort 
identically to main;
   in groups with one (2,061), out-of-order dependencies total 3,882 vs 4,618.
   
   </details>
   
   related: #73678
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to