4 ms·
> Supervisor should've killed celery's forked workers once the parent dies. Either it is not reliable or we haven't been able to make this happen in at least a
by zbentley 5y ago
> Supervisor should've killed celery's forked workers once the parent dies. Either it is not reliable or we haven't been able to make this happen in at least a few attempts now.
Use systemd instead of supervisord for misbehaving forking daemons like this. If you set "KillMode=mixed" you get a nice compromise between "signal the parent and give things a configurable grace period to shut themselves down" and "zero risk of orphaned child (or stuck parent) processes being left around after service stop/restart".
Without weighing in on the systemd-vs-other-init debate in general, I do strongly believe that systemd fully obsoletes supervisord. The (slightly) tighter coupling supervisord offers with Python isn't worth the deficient feature set.
- syro 5y agosupervisord still has a place in scenarios where you can't or don't want to use the init system. WSL2 and docker containers running multiple processes come to mind. In most linux environments, this is a non-issue. And some will argue you are using containers wrong if you are running multiple services in a single container, but containers as a reproducible environment and isolation unit is a valid use case (for test/dev environments especially).
- boardwaalk 5y agoJust want to point out there are options other than supervisord. You can even use systemd in a container, though I would avoid it. s6 and runit are both options. Using something Python-based for this sort of thing makes me slightly nervous.
- js2 5y agoI find supervisor's event listener functionality useful for implementing watchdog processes. I have the supervised process write an event whenever it successfully completes a task. Meanwhile, a separate event listener process has a watchdog timer which asks supervisor to restart the supervised process if it hasn't checked in recently enough. Does systemd have anything like supervisor events? http://supervisord.org/events.html#events http://supervisord.org/events.html#events
- tomnipotent 5y agoYes, sd_notify(0, "WATCHDOG=1") should get you started.