Skip to content

tplink-connection leaks promises in Queue object #24

@jimrushPersonal

Description

@jimrushPersonal
this.on('timeout', () => {
  this.log.debug(
    `TplinkConnection(${this.description}): timeout()`,
    this.host,
    this.port
  );
  this.queue.add(async () => {
    this.close();
  });
});

The promise is never triggered. So, after every timeout, a promise will be leaked in the Queue object. Note, the current close function only performs a log statement, so the actual need for a promise in the current codebase.

I discovered this on a device that I think has a dubious network connection (HS300PowerStrip) and numerous children. I did see a couple of tplink-connection objects in memory tied to that IP address, but that may have just been for the children.

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