Hello, this is my first question here and I hope it doesn't sound stupid, I'm using supervisord to run the jobs, I've read somewhere that if you stop the process from supervisord it send a kill signal to all the jobs and then they will handle their business before getting shut down (the states of the job goes to failed? I'd suppose)
Now my second question is that does the same thing happen, if a server shutdown occurs? Either a manual shutdown via the ssh, or when a data center's downtime issue occurs?
It's kind of important for my application, that the job's states get handled.
it's important to distinguish between worker and job
when supervisor asks the workers to stop they will complete the current job then not start a new one ( that's my understanding) and then shutdown. If they can complete the job gracefully probably depends how long your jobs take to run and if related dependent services go down before they finish, eg mysql on the same server may be told to shutdown at the same time so the state of the job will be indeterminate
This is why there are things like redundant power and planned outages
Best way to protect your app is to shut it down first. As you cannot always guarantee this you should think about detecting incomplete activity