Skip to content

Conversation

@tirkarthi
Copy link
Contributor

@tirkarthi tirkarthi commented Nov 22, 2025

Filtering by DagRun.run_id results in fetching other dagruns of same run_id which could be in running state with end_date as None. Filter by DagRun.id to get only the dagrun relevant and prune deadlines associated with it.

Closes #58560

@tirkarthi
Copy link
Contributor Author

For some reason session.merge is required for tests but the patch works without it in the scheduler with end_date set. Please add in if I am missing something in test setup.

@ferruzzi
Copy link
Contributor

You've said you were able to recreate the issue; I presume you've tested this change and it fixes the issue?

@tirkarthi
Copy link
Contributor Author

Yes, the tests also fail when the query is changed giving the traceback as reported in the issue. The issue can be reproduced with 2 dags with a deadline and task of time.sleep(10) and time.sleep(100) respectively
When dag1 completes it tries to prune deadline for dag2 of same run_id. This is fixed by using DagRun.id to get deadline associated with only the dagrun and avoids retrieving other dagruns of same run_id.

My question was that tests required session.merge but testing it manually in the UI with above setup didn't require it.

@ferruzzi
Copy link
Contributor

I'm a little scattered right now, just got back from vacation and getting pulled in a few directions. I THINK the issue is that the dag_maker fixture doesn't merge. Try the same tests but creating the DAG from scratch like some of the others in that file do. I'm pretty sure that was the fix when I ran into it in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler pod crash because of Deadline set on DAG

2 participants