Discussed in #8994
Originally posted by lewijw April 30, 2024
I'm running celery in a pod in k8s, and I am seeing a situation where it starts as PID 1, writes the pid file, and seems to crash for some reason. Then, k8s restarts the process; it starts again as PID 1; but since the pid file has a 1 in it, I am wondering if it is killing itself? I'm not a python expert, but this code seems to need a comparison of os.getpid() with the contents of the pid file before killing the process.
https://github.com/celery/celery/blob/main/celery/platforms.py#L191
Discussed in #8994
Originally posted by lewijw April 30, 2024
I'm running celery in a pod in k8s, and I am seeing a situation where it starts as PID 1, writes the pid file, and seems to crash for some reason. Then, k8s restarts the process; it starts again as PID 1; but since the pid file has a 1 in it, I am wondering if it is killing itself? I'm not a python expert, but this code seems to need a comparison of os.getpid() with the contents of the pid file before killing the process.
https://github.com/celery/celery/blob/main/celery/platforms.py#L191