terminus icon indicating copy to clipboard operation
terminus copied to clipboard

On shutdown, health request before signal interrupted with ECONNREFUSED

Open soryy708 opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current behavior

When the application is shutdown (e.g. with SIGTERM shutdown hook), requests that started before shutdown fail with ECONNREFUSED.

Minimum reproduction code

https://github.com/soryy708/nestjs-disgraceful-shutdown-mcve

Steps to reproduce

  1. Install dependencies by running yarn install
  2. Run the tests by running yarn test

Expected behavior

Requests that started before shutdown should succeed, only new requests after shutdown should fail.

Package version

9.2.2

NestJS version

9.3.12

Node.js version

16.19.0

In which operating systems have you tested?

  • [X] macOS
  • [X] Windows
  • [ ] Linux

Other

Moved from https://github.com/nestjs/nest/issues/11416

soryy708 avatar Jun 21 '23 11:06 soryy708