karenbraganz commented on PR #53435:
URL: https://github.com/apache/airflow/pull/53435#issuecomment-3127508820

   @Nataneljpwd The session being expunged in the link you provided is not the 
same session being used in `_maybe_requeue_stuck_ti`.  The function 
`_maybe_requeue_stuck_ti` uses the session that is [passed to it when it is 
called in 
_handle_tasks_stuck_in_queued](https://github.com/apache/airflow/blob/f1a76a104a4fb42d87bb6e5fb6d3f071f991d9eb/airflow-core/src/airflow/jobs/scheduler_job_runner.py#L1976).
 This session is [created in 
_handle_tasks_stuck_in_queued](https://github.com/apache/airflow/blob/f1a76a104a4fb42d87bb6e5fb6d3f071f991d9eb/airflow-core/src/airflow/jobs/scheduler_job_runner.py#L1957)
 and is not committed [until after _maybe_requeue_stuck_ti is 
completed](https://github.com/apache/airflow/blob/f1a76a104a4fb42d87bb6e5fb6d3f071f991d9eb/airflow-core/src/airflow/jobs/scheduler_job_runner.py#L1978),
 so I did not expect the TaskInstance to be detached from the session in 
`_maybe_requeue_stuck_ti`.  Please let me know if I am mistaken about 
something. 


-- 
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