github-actions[bot] opened a new pull request, #71955:
URL: https://github.com/apache/airflow/pull/71955

   TaskInstance.set_state is @provide_session: called without a session,
   every pending task instance gets its own session — a fresh DB
   connection (with the documented sql_alchemy_pool_enabled=False +
   pgbouncer setup), a refresh SELECT, a merge SELECT, an UPDATE and a
   COMMIT. Marking a dag run failed on a run with 3,917 mapped task
   instances took 280 s (~19,500 statements, ~3,900 connections) on an
   otherwise idle PostgreSQL 17 with 2.5 ms RTT.
   
   Passing the ambient session through drops the per-TI cost from 79 ms
   to 7.5 ms measured on the same run (x10.5); the dag-run state and the
   running-TI path already use this session, so transactional semantics
   are unchanged.
   (cherry picked from commit 0807f2b5f757a2ab4a908c6194a0f9ac8c9e2f98)
   
   Co-authored-by: Mat <[email protected]>
   Co-authored-by: Claude Fable 5 <[email protected]>


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