GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-python
DeprecationWarning from os.fork() on Python 3.14 runtime
- 主要語言
- Python
- 星號
- 968
- 分支
- 128
- PR 合併指標
- 30 天內沒有已合併 PR
描述
## Description
When using runtime = "python314" for Cloud Run Functions, gunicorn's Arbiter.spawn_worker() triggers a deprecation warning:
`
/layers/google.python.pip/pip/lib/python3.14/site-packages/gunicorn/arbiter.py:694: DeprecationWarning: This process (pid=1) is multi-threaded, use of fork() may lead to deadlocks in the child.
pid = os.fork()
`
Python 3.14 warns about fork() in multi-threaded processes. The functions-framework has gunicorn>=22.0.0 as a hard dependency (setup.py line 54), and gunicorn uses fork() to spawn workers.
## Impact
- The warning cannot be suppressed from user code because os.fork() is called by gunicorn before the user's module is imported
- This will likely become an error in a future Python version
- Affects every Cloud Run Function using python314 runtime
## Suggested fix
Replace gunicorn with a server that uses spawn instead of fork (e.g., uvicorn supports --workers N with spawn), or wait for gunicorn to add spawn support.
## Reproduction
Deploy any Cloud Run Function with runtime = "python314" and observe the warning in logs.
貢獻指南
研究方向
從 setup.py 第 54 行以及 arbiter.py:694 中回報的 gunicorn Arbiter.spawn_worker() 呼叫開始。透過部署一個 runtime="python314" 的 Cloud Run Function 進行重現,並檢查日誌中的警告。完成的要求是確定一種能夠避免該警告的伺服器或 worker 建立方案,但該 issue 沒有規定應實作哪一種方案。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100