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

tplink-connection leaks promises in Queue object #24

Open
jimrushPersonal opened this issue Oct 19, 2021 · 0 comments
Open

tplink-connection leaks promises in Queue object #24

jimrushPersonal opened this issue Oct 19, 2021 · 0 comments

Comments

@jimrushPersonal
Copy link

jimrushPersonal commented Oct 19, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant