mattp- commented on code in PR #54510:
URL: https://github.com/apache/airflow/pull/54510#discussion_r2277152368


##########
airflow-core/src/airflow/utils/serve_logs/core.py:
##########
@@ -54,11 +54,11 @@ def serve_logs(port=None):
     logger.info("Starting log server on %s", serve_log_uri)
 
     # Use uvicorn directly for ASGI applications
-    uvicorn.run("airflow.utils.serve_logs.log_server:app", host=host, 
port=port, workers=2, log_level="info")
     # Note: if we want to use more than 1 workers, we **can't** use the 
instance of FastAPI directly
-    # This is way we split the instantiation of log server to a separate module
+    # This is why we split the instantiation of log server to a separate module
     #
     # 
https://github.com/encode/uvicorn/blob/374bb6764e8d7f34abab0746857db5e3d68ecfdd/docs/deployment/index.md?plain=1#L50-L63
+    uvicorn.run("airflow.utils.serve_logs.log_server:app", host=host, 
port=port, workers=1, log_level="info")

Review Comment:
   ```
   mphillips81@mmp-pw-dev /tmp/af3/.venv/lib/python3.10/site-packages/airflow % 
grep -rsi 'uvicorn'
   cli/commands/api_server_command.py:import uvicorn
   cli/commands/api_server_command.py:        log.warning("Running in dev mode, 
ignoring uvicorn args")
   cli/commands/api_server_command.py:                Running the uvicorn with:
   cli/commands/api_server_command.py:        uvicorn.run(
   Binary file cli/commands/__pycache__/api_server_command.cpython-310.pyc 
matches
   ```
   i think uvicorn is only being hit from api-server in the released 3.0.4 - 
the problem in main is the uvicorn.run is happening wrapped by a 
multiprocessing.Process when log-server is spawned - those changes aren't in 
3.0.4



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