Open kbzowski opened 5 months ago
Hi @kbzowski Sorry for the delayed response! @andrey-zelenkov Can you have a look at this, please as you have worked with some of the NodeJS fixes before.
I also found that after SIGINT
, the server's 'close' event will be automatically executed, it didn't wait for all my requests to finish; instead, it directly interrupted the requests.
For applications that require a graceful exit, it is advisable to support manual closure.
https://nodejs.org/dist/latest/docs/api/net.html#serverclosecallback
server.on('close', () => {
console.log('server closed');
});
I have notice that during shutdown of NestJS based application which uses express internally I got an error:
Origin of the error is the close() function https://github.com/nestjs/nest/blob/master/packages/platform-express/adapters/express-adapter.ts#L160 which calls http.close(). As far as I can see unit does not implement this function. Correct me please if I don't understand something.