fix: Worker health check 扫描全部 /proc 进程修复 unhealthy 误判 #1825
Reference in New Issue
Block a user
Delete Branch "fix/worker-healthcheck-ci-e2e"
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?
问题
Worker 容器内无 pgrep/ps 工具,旧 health check 使用
grep -q celery /proc/1/cmdline检查 PID 1 的 cmdline,但 PID 1 是entrypoint-worker.sh(bash 脚本),不含 celery 关键字,导致 health check 永远返回 unhealthy。同时 deploy 脚本中
sh -c嵌套引号导致$pid变量被外层 shell 提前展开为空。修复
改用
grep -lq celery /proc/[0-9]*/cmdline扫描容器内所有进程的 cmdline,找到任意 celery 进程即判定 healthy。无需变量、无嵌套 shell、无 pgrep 依赖。影响文件
infra/docker/compose.ymlinfra/docker/deploy-staging-registry.shinfra/docker/deploy-production-registry.sh🚀 预览环境已部署
f2ab0c87a2toec5cc4c206ec5cc4c206to54defa4429🗑️ 预览环境已清理
PR #1825 已关闭或合并,对应的预览环境已被清理。