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 when using scopes with recursive timers #227

Merged
merged 1 commit into from
Aug 13, 2018

Conversation

rochdev
Copy link
Member

@rochdev rochdev commented Aug 13, 2018

This PR fixes a memory leak when using scopes with recursive timers.

The problem is that context executions are only completely removed from the linked list of the current context when no scope is created inside them. This works for most use cases, but not if scopes are created in recursive timers. Since every new context is always a child of the previous context, this creates an infinite number of nested contexts that are never cleaned up. The most common use case for this are task queues, which are used internally in a few libraries such as Bluebird.

@rochdev rochdev merged commit 1999ee7 into master Aug 13, 2018
@rochdev rochdev deleted the fix-nested-context-leak branch August 13, 2018 20:43
@rochdev rochdev added this to the 0.5.5 milestone Aug 14, 2018
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