jason810496 commented on code in PR #61281:
URL: https://github.com/apache/airflow/pull/61281#discussion_r2799956286


##########
airflow-core/newsfragments/61214.significant.rst:
##########
@@ -0,0 +1 @@
+Documented known limitation: API server may crash when 
``PYTHONASYNCIODEBUG=1`` or ``PYTHONDEVMODE`` is enabled on Python 3.12+ due to 
uvloop incompatibility with asyncio debug mode.

Review Comment:
   And we could remove the `airflow-core/newsfragments/61214.significant.rst`, 
since we just add the warning instead of functional change.



##########
airflow-core/src/airflow/api_fastapi/main.py:
##########
@@ -23,21 +23,6 @@
 # This ensures plugins loaded at import time get the correct secrets backend 
chain
 os.environ["_AIRFLOW_PROCESS_CONTEXT"] = "server"
 
-# Defensive: Disable uvloop if PYTHONASYNCIODEBUG=1 is set (see Airflow issue 
#61214)
-if os.environ.get("PYTHONASYNCIODEBUG") == "1":
-    import asyncio
-    import warnings
-
-    # Explicitly set the default event loop policy to prevent uvloop from 
being used
-    asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
-
-    warnings.warn(
-        "PYTHONASYNCIODEBUG=1 detected: uvloop is not compatible with asyncio 
debug mode on Python 3.13+. "
-        "Using default asyncio event loop.",
-        RuntimeWarning,
-        stacklevel=2,
-    )
-

Review Comment:
   I think we can still keep the warning, but just remove the 
`asyncio.set_event_loop_policy` and check the python minor version (larger 
equal than 3.12) in the `if` case as Pierre mentioned.



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