Skip to content

Multiple gateways with socket.io get (disconnect listeners added to [Socket]) #7287

@aviadhadidainx

Description

@aviadhadidainx

Bug Report
Current behavior
Using multiple gateway (Same socket io server).
When there a connection we get 'Possible EventEmitter memory leak detected. X disconnect listeners added to [Socket]'

It looks like for every gateway for every connection is subscribed to disconnect event(Also connect). Look on image below:
image

image
The file is ws-adapter.js

Expected behavior
Not to get this warning or at least understand what can cause it and what is the risk

Possible Solution
N/A

Environment

Nest version: 7.6.11

I also tried to update to latest but with no success

For Tooling issues:

  • Node version: 12.16.3
  • Platform: Windows

Attached example project that reproduce this issue.
When you start the project you can see the warning on logs..

https://github.com/nestjs/nest/issues/7228

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions