Skip to content
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/platform-ws: Application shutdown hangs #13534

Closed
3 of 15 tasks
bettercalljason opened this issue May 4, 2024 · 1 comment · Fixed by #13531
Closed
3 of 15 tasks

@nestjs/platform-ws: Application shutdown hangs #13534

bettercalljason opened this issue May 4, 2024 · 1 comment · Fixed by #13531
Labels
needs triage This issue has not been looked into

Comments

@bettercalljason
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The application shutdown hangs when shutdown hooks are enabled and there are existing (open) websocket connections.

Minimum reproduction code

https://stackblitz.com/edit/nestjs-typescript-starter-1jpeel?file=src%2Fmain.ts&view=editor

Steps to reproduce

  1. In a first terminal, run npm install && npm start
  2. In a second terminal, run node client.mjs to open a WebSocket connection
  3. In the first terminal, stop the application (Ctrl+C)
  4. In the first terminal, run npm install && npm start again -> You get an Error: listen EADDRINUSE: address already in use :::3000 because the application didn't terminate before.

Expected behavior

The application should have shutdown completely and starting it again should not be an issue.

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

10.3.2

Packages versions

[Nest CLI]
Nest CLI Version : 10.3.2

[Nest Platform Information]
platform-express version : 10.3.2
platform-ws version : 10.3.2
websockets version : 10.3.2
schematics version : 10.1.1
testing version : 10.3.2
common version : 10.3.2
core version : 10.3.2
cli version : 10.3.2

Node.js version

20.12.2

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@bettercalljason bettercalljason added the needs triage This issue has not been looked into label May 4, 2024
@kamilmysliwiec
Copy link
Member

Let's track this here #13531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants