myps6415 commented on PR #67592: URL: https://github.com/apache/airflow/pull/67592#issuecomment-4758431747
@ashb thanks for the review! **On the `end_date` guard (task_instances.py):** You're right. Since each retry is a separate TI row and the scheduler refreshes `queued_dttm` on every queueing, a retry genuinely waits in the queue and its `utcnow() - queued_dttm` is a valid sample (this also matches the legacy `emit_state_change_metric`, which fired on every transition to RUNNING). The `end_date` check was both fragile and semantically wrong, so I've dropped it — the guard is now just `queued_dttm is not None and next_method is None`, keeping only the deferral-resume skip. Also removed the now-unused `TI.end_date` from the select. **On the test:** Reworked it to assert the real invariant rather than the test setup: the emit case now has a `retry` parametrization where `end_date` is set on the row (the retry signature) and asserts the metric *still* fires — so a future regression that re-suppresses on `end_date` would fail here. The skip case now only covers `deferral_resume` and `queued_dttm_missing`. -- 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]
