FrankYang0529 commented on PR #72048:
URL: https://github.com/apache/airflow/pull/72048#issuecomment-5692870843

   Thanks for the second review. Learn a lot from you comment.
   
   1. Callbacks: `queue_workload()` now records the key of both workload types, 
so `slots_available` and `slots_occupied` count callbacks too. For that to 
work, a callback row has to map back to its `CallbackKey`. Otherwise the 
reconciliation in `_purge_jobs()` drops the key on the next sync and the state 
block never matches the row.
   
   2. Adoption: `try_adopt_task_instances()` only considers rows in `QUEUED`, 
`RESTARTING` or `RUNNING` and doesn't return finished rows (`SUCCESS`, 
`FAILED`, or `REMOVED`).
   
   3. `running.add()` before the commit: keep the behavior with a comment at 
the call site. `BaseExecutor.queue_workload()` has the same pattern: it fills 
`queued_tasks` before the caller commits, and nothing removes that entry on 
rollback. Here the DB reconciliation in `_purge_jobs()` corrects an over-report 
within one heartbeat.
   


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