nagasrisai opened a new pull request, #70041:
URL: https://github.com/apache/airflow/pull/70041

   The `dag_processing.processes` metric description states that its delta is 
negative when parsers complete. However `_collect_results()`, the normal 
graceful exit path, never emitted a matching `stats.decr`. Only the three 
abnormal exit paths (stop/timeout/terminate) decremented the counter, so the 
gauge drifted upward indefinitely under normal operation.
   
   Add `stats.decr` with `action="success"` inside `_collect_results()` after 
each finished processor is popped. Guard the `_get_team_names` call with an 
early return when no processors finished to avoid a pointless DB query on the 
common no-op iteration.
   
   Closes #69984
   
   ---
   
   ### Testing
   
   Added a parametrized test `test_collect_results_emits_decr_on_success` in 
`TestMultiTeamMetrics` covering both `multi_team=True` (with `team_name` tag) 
and `multi_team=False` (without `team_name` tag), following the same pattern as 
the existing `test_terminate_includes_team_name` and 
`test_terminate_orphan_processes_includes_team_name` tests.


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