Skip to content

Possible memory leak-- processPromiseRejections never called? #262

@mattkrick

Description

@mattkrick

After migrating from express to uwebsockets, i noticed a memory leak caused by node holding onto unhandled rejections and never flushing them
Screen Shot 2020-01-12 at 7 54 53 PM

The pendingUnhandledRejections array is emptied when processPromiseRejections is called: https://github.com/nodejs/node/blob/c9b93e234454322ac0b7a6cd29d394f428f3e37d/lib/internal/process/promises.js#L171

It should get called every tick here: https://github.com/nodejs/node/blob/68abaab8baac203833889c9106abf6fe82a5900f/lib/internal/process/task_queues.js#L98

Perhaps the task queue is never empty, so !queue.isEmpty() || processPromiseRejections() always shortcircuits? Any guidance appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions