Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Vendure supports gracefully shutdowns? #2474

Closed
Zizitto opened this issue Oct 20, 2023 · 2 comments
Closed

Does Vendure supports gracefully shutdowns? #2474

Zizitto opened this issue Oct 20, 2023 · 2 comments

Comments

@Zizitto
Copy link

Zizitto commented Oct 20, 2023

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?

@michaelbromley
Copy link
Member

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: nestjs/nest#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:

  1. The onModuleDestroy() hook here is called, which invokes and awaits stop() on all running job queues.
  2. This in turn calls the stop() method of the configured JobQueueStrategy. This can therefore be configured to the desired behaviour. The default strategy in the DefaultJobQueuePlugin, for instance, will execute this logic that waits 2 seconds for running jobs to complete.

@dlhck
Copy link
Collaborator

dlhck commented Sep 24, 2024

This looks like a general support request rather than an issue specifically related to this project. For community support, you are welcome to join our Discord community](https://vendure.io/community) where you can post your question in the #help channel. In case your company needs dedicated support please reach out to us via our contact form.

If you think I've made a mistake and this is indeed an issue specific to this project, please reply and the issue can be re-opened if needed.

@dlhck dlhck closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants