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
[nestjs] Incorrect shutdown #9237
Comments
Facing the same issue, any temporary fix available ? |
nope( |
What I did is reverting @nrwl/node to 13.8.3 |
Found the issue: Multiple signals are received by the app:
On the first signal, NestJS removes all listeners, and the next signal kills the app A simple way to fix this issue is to add the following code to your main.ts file before NestJS bootstrap.
It will add additional listeners to signals, and the app will not be killed but gracefully stopped by NestJS. |
@mark-b-ab the bug seems to happen if I have async operations inside of the hooks. Just want to give you an update. I'm still looking into the process handling |
@nartc why was this closed? Using latest everything from nx, I am still experiencing the original behavior noted by @mark-b-ab. |
@nartc bumping this again. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Starting 13.8.4 (when
@nrwl/node:execute
was replaced by@nrwl/node:node
) Nx incorrectly handles shutdown on NestJS apps with shutdown hook.Steps to Reproduce
nx serve
Current Behavior
1 log message:
onModuleDestroy before wait
Expected Behavior
3 log messages:
onModuleDestroy before wait
onModuleDestroy after wait
onApplicationShutdown
Environment
The text was updated successfully, but these errors were encountered: