Skip to content

MaxListenerExceededWarning with restify 8.6.0 #1883

@luddd3

Description

@luddd3

When I updated to latest version of Restify. I started to get memory leak warnings.

  • Used appropriate template for the issue type
  • Searched both open and closed issues for duplicates of this issue
  • Title adequately and concisely reflects the feature or the bug

Restify Version: 8.6.0
Node.js Version: 14.18.1

Expected behaviour

No warnings

Actual behaviour

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:475:17)
    at Socket.addListener (events.js:497:10)
    at Socket.Readable.on (internal/streams/readable.js:853:35)
    at Socket.socketListenerWrap [as on] (_http_server.js:950:54)
    at Socket.once (events.js:541:8)
    at readBody (/code/node_modules/restify/lib/plugins/bodyReader.js:189:20)
    at nextTick (/code/node_modules/restify/lib/chain.js:167:13)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

Repro case

I don't know how to minimally reproduce it. I am running with a fairly large server in prod.

Cause

I suspect that this is the cause: #1880

Are you willing and able to fix this?

No, I am not able to fix it beyond just reverting the change in the pull request referenced above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions