Open Zizitto opened 9 months ago
Hi,
Since Vendure is built on NestJS, it handles graceful shutdowns the same way, described here: https://docs.nestjs.com/fundamentals/lifecycle-events#application-shutdown
The specific issue of requests being terminated is discussed in this issue: https://github.com/nestjs/nest/issues/11416 - it seems like it is something that needs to be addressed in NestJS itself.
As for jobs that are being processed - here's what happens:
onModuleDestroy()
hook here is called, which invokes and awaits stop()
on all running job queues.
https://cloud.google.com/run/docs/samples/cloudrun-sigterm-handler
Our Vendure server is deployed via Cloud Run, worker is deployed via Kubernetes.
Both deployments from time to time receive SIGTERM signals. (during deployment of some changes or scale-downs).
Looks like HTTP requests and jobs processing are terminating immediately, which causes data inconsistency issues.
Can somebody check if Vendure supports gracefully shutdowns?