diogosilva30 commented on PR #68078:
URL: https://github.com/apache/airflow/pull/68078#issuecomment-4659859321

   Hey @jscheffl 
   
   I believe it's not redundant, but somewhat complementary.
   
   After more investigation I found the situation is more nuanced than the 
original PR description suggested, and I've updated the PR body accordingly:
   
   **On main**: the bug doesn't actually reproduce. Stats gets initialized in 
the API server process by accident: task_runner.py imports serde at module 
level, which triggers serde._register() → Stats.initialize(...) as a side 
effect of import airflow. This PR is therefore hardening on main: it makes the 
initialization explicit and self-contained instead of relying on that fragile 
import side effect (which would silently regress if that module-level import 
ever became lazy). Details 
[here](https://github.com/apache/airflow/issues/68077#issuecomment-4635221726). 
So the metrics being introduced in https://github.com/apache/airflow/pull/64523 
work but there's no explicit initialisation of `Stats.initialize()` so it's a 
fragile dependency on `serde` import, which can easily regress in a future 
version if imports change back to lazy like it happened in 
https://github.com/apache/airflow/pull/63932. So this current MR can be viewed 
as a pre-requisite hardening (including regression test) 
 to make sure `Stats` are always initialised on API server so neither the edge 
worker metrics and metrics being introduced in 
https://github.com/apache/airflow/pull/64523 are ever silently dropped by 
mistake.
   
   **On 3.2.x**: the bug is real and verified. The serde import in task_runner 
is lazy on 3.2.x, so the accidental init never fires in the API server process. 
Stats stays NoStatsLogger → all edge_worker.* metrics are silently dropped. A 
3.2.x backport is the actual user-visible fix.
   


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