GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-python

DeprecationWarning from os.fork() on Python 3.14 runtime

Đang mở
#420 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement P2
Ngôn ngữ chính
Python
Star
968
Fork
128
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.