fix(P0): gpu-encoder 冷启动防护 — pre-warm + 首字节短超时兜底 #2072
Reference in New Issue
Block a user
Delete Branch "fix/p0-gpu-encoder-cold-start-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
P0 背景
2026-09-27 staging 观测到 job a15a4667:worker 14:10:26 完成mezzanine上传并POST P4000,但P4000直到14:12:55才GET mezzanine,空等149.6s,ffmpeg实际只跑3.2s。
69个历史job仅1个>1s延迟(其余<0.34s),长时间空闲后TCP握手仍~10ms,无法稳定复现。疑为Tailscale DERP打洞/httpx连接池重建偶发卡顿。
修复(worker客户端兜底)
在 packages/shared/gpu_encoder.py 加两层防御:
check_health() 在healthy时刷新_last_ok_ts。
新增配置(均有默认值)
服务端根因待继续
P4000 SSH未打通,拿到后看 /home/ying/p4000-encoder/server.py 的 httpx timeout/limits、asyncio.Lock、DNS resolver、uvicorn worker数,服务端修复另提PR。
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #2072 已关闭或合并,对应的预览环境已被清理。