mixpanel / mixpanel-node

A node.js API for mixpanel
http://www.mixpanel.com
MIT License
477 stars 159 forks source link

Suspected memory leak in `0.10.3` and above #161

Closed JohanBengtsson closed 4 years ago

JohanBengtsson commented 5 years ago

Background of issue

When updgrading to version 0.10.3 a few weeks ago, we've experienced extreme memory leaks in our Node application using this library. We've verified it's this exact version of mixpanel that causes the issue. More specifically we believe it's the updrade of the dependency https-proxy-agent to 3.0.0 was the root cause, i.e. this commit

Temporary workaround

We've solved this temporarily by locking mixpanel to 0.10.2 and solving the https-proxy-agent security vulnerability by resolving it to a secure version in our package.json:point_down:

  {
   "mixpanel": "0.10.2",
  },
  "resolutions": {
    "https-proxy-agent": "^2.2.3"
  }  

Questions

Can someone confirm whether our suspicions about a memory leak existing in version 0.10.3 of this library are correct? If yes, is there a maintainer that can get out patch for this?

tdumitrescu commented 5 years ago

Thanks, we'll take a look. Out of curiosity, are you actually using a proxy (via the HTTPS_PROXY environment variable) or is it just the fact of importing https-proxy-agent that triggers the memory leak?

JohanBengtsson commented 5 years ago

Thanks for your reply!

It seems now that the memory leak has returned after a few days regardless of the workaround I stated about. Something is fishy here and I think we'll have to do some further intestigation. Will come back with more information in a couple of days!

JohanBengtsson commented 4 years ago

After some more tests, we suspect the problem must lie somewhere else. Will close this now.