You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running nest start and then terminating the application using CTRL+C doesn't await asynchronous shutdown hooks (onModuleDestroy, beforeApplicationShutdown, onApplicationShutdown). Instead, the process exits before they are completed, but the application still completes gracefully.
Is there an existing issue for this?
Current behavior
Running
nest startand then terminating the application usingCTRL+Cdoesn't await asynchronous shutdown hooks (onModuleDestroy,beforeApplicationShutdown,onApplicationShutdown). Instead, the process exits before they are completed, but the application still completes gracefully.Things I've tried:
app.enableShutdownHooks();is enabledEADDRINUSEerror when using start with watch mode with an asyncbeforeApplicationShutdown#1614 that was fixed by--no-shell; however, it doesn't resolve the problem here.Minimum reproduction code
https://github.com/MrBartusek/shutdown-bug
Steps to reproduce
app.module.tshttps://github.com/MrBartusek/shutdown-bug/blob/master/src/app.module.tsnest startCTRL+CExpected behavior
Running
node dist/mainwaits for shutdown correctly, I would expect it would work the same herePackage version
11.0.10
NestJS version
11.1.6
Node.js version
20.19.2
In which operating systems have you tested?
Other
I'am using WSL with Ubuntu 22.04.3