-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Production server doesn't stop with preset node-cluster #23723
Comments
Would you confirm i f this happens with nitro alone, and if so raise an issue there? 🙏 |
Consider nitro server hase a graceful shutdown mechanism. If a request is pending for some reason or an active resource like DB connection hanging, this can happen regardless using nuxt or not. Regardless i would be happy to help finding a solution also here if you can make a runnable reproduction. Nuxt is okay too 👍🏼 |
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
Yes, I noticed the graceful shutdown mechanism, that's why I mentioned |
@Cheaterman If you can make a Nuxt reproduction, that would also work! @Mateleo Thanks for sharing. If your "build step" like the above fails, it is probably because of an unclosed handler made by a module or during the prerender process (from screenshot above I cannot tell). Here is the more relevant issue: nuxt/cli#193 |
@pi0 You were right, it's the same issue : nuxt/cli#193 Temporary workaround export default defineNuxtConfig({
hooks: {
close: (nuxt) => {
if (!nuxt.options._prepare)
process.exit()
}
}
}) |
Let's track in nuxt/cli#193 in that case. |
Environment
Reproduction
NITRO_PRESET=node-cluster
:NITRO_PRESET=node-cluster pnpm build
node .output/server/index.mjs
pkill -f 'node .output' -TERM
(SIGINT works too)Describe the bug
One would expect production server to stop instantly at the first SIGINT/SIGTERM, instead it either takes two or needs a SIGKILL.
Additional context
Logs
No response
The text was updated successfully, but these errors were encountered: