vatsrahul1001 opened a new pull request, #75715: URL: https://github.com/apache/airflow/pull/75715
Manual backport of #75689 to `v3-4-test`. The auto-backport conflicted because #75689 was built on two features that are **not on `v3-4-test`** (both 3.5.0-scoped and deliberately kept off the branch). This is a **pruned subset** that drops the parts depending on them and keeps the FastAPI/cadwyn bump plus the lazy-router + native-OpenTelemetry-disable adaptations. **Dropped (absent from `v3-4-test`):** - REST API metrics (#64523): `common/http_metrics.py` + its test + the `HttpMetricsMiddleware` import/tests in `app.py` / `test_app.py`. - Dag-processor scoped Execution API access (#74370): the token-scope test fixtures (`JOB_UNCHECKED_ROUTES`, `DAG_PROCESSOR_*` dicts) and `TestDagProcessorMessageRoutes` in `test_token_scope_boundaries.py`. **Kept / adapted:** - `fastapi>=0.142` (resolves 0.161) + `cadwyn>=8.1` in airflow-core and task-sdk (+ `uv.lock`). - `NATIVE_TELEMETRY_DISABLED` applied to all FastAPI apps (core, execution, log server). - Lazy-router adaptation (`iter_route_contexts` / `iter_api_routes`) in `execution_api/app.py` and the remaining execution-API tests, including `test_token_scope_boundaries.py::TestTokenScopeBoundaries` and the new `test_fastapi_native_telemetry_records_no_spans`. - `taskinstance.py` `Discriminator(...)` change. **Verified locally:** no conflict markers, `py_compile` clean, and the remaining source references only symbols present on `v3-4-test` (`require_auth`, `_REQUEST_SCOPE_TOKEN_KEY`, `InProcessExecutionAPI`) plus fastapi 0.161's `iter_route_contexts`. Full execution-API test validation runs here in CI under fastapi 0.161. **Note:** this does **not** recover the api-server memory regression — an isolation soak measured +0.4% (noise); the single-process ~20 MB `Dependant` saving is a build-time cost swamped at steady state. Treat this as a FastAPI-currency + native-OTel-correctness change, not the memory fix. The ~10% api-server floor in 3.4 is intrinsic. cc @jedcunningham (original author) and Wei Lee — please review the subset selection, especially the dropped #64523/#74370 pieces and the `test_token_scope_boundaries.py` adaptation. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.8) Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
