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

fix memory leak caused by a bug in node with http keep-alive #581

Merged
merged 3 commits into from
Jun 4, 2019

Conversation

rochdev
Copy link
Member

@rochdev rochdev commented May 31, 2019

This PR fixes a memory leak caused by a bug in Node with HTTP keep-alive. In older Node versions, the destroy hook wasn't called when a socket would be reused. Any code relying on destroy to be called to clean up resources, including dd-trace, would end up with a memory leak. By monitoring these resources and storing the previous ID in a WeakMap, we can work around the issue and call destroy ourselves when the resource is reused.

See nodejs/node#19859

@rochdev rochdev added bug Something isn't working core labels May 31, 2019
@rochdev rochdev added this to the 0.12.0 milestone May 31, 2019
@rochdev rochdev requested a review from rishabh May 31, 2019 23:18
@rochdev rochdev changed the base branch from v0.12.0 to master June 4, 2019 16:45
@rochdev rochdev changed the base branch from master to v0.12.0 June 4, 2019 16:48
@rochdev rochdev merged commit c6e182b into v0.12.0 Jun 4, 2019
@rochdev rochdev deleted the fix-keep-alive-leak branch June 4, 2019 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants