You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's at least theoretically possible for a ManualPromise to be complicit in a memory leak, in cases where an instance is only needed so that one of its settling methods can be called. Once an instance has actually been settled, then it can't possibly be settled again, and that means that a "settler" object (a) doesn't need to refer to the original ManualPromise nor to the underlying (regular) promise, nor to the settled value; and (b) if it does refer to any of those and is a long-lived object, then that "settler" would be a source of a leak.
In the current implementation, there is no separate "settler" object from a ManualPromise instance, and ManualPromise itself necessarily maintains a reference to the settled value. So, the possibility of a leak is kinda inherent in the design. This can be fixed.
To reproduce
Not yet known.
Expected behavior
No leaks can occur due to reasonable uses of this class.
Describe the bug
It's at least theoretically possible for a
ManualPromise
to be complicit in a memory leak, in cases where an instance is only needed so that one of its settling methods can be called. Once an instance has actually been settled, then it can't possibly be settled again, and that means that a "settler" object (a) doesn't need to refer to the originalManualPromise
nor to the underlying (regular) promise, nor to the settled value; and (b) if it does refer to any of those and is a long-lived object, then that "settler" would be a source of a leak.In the current implementation, there is no separate "settler" object from a
ManualPromise
instance, andManualPromise
itself necessarily maintains a reference to the settled value. So, the possibility of a leak is kinda inherent in the design. This can be fixed.To reproduce
Not yet known.
Expected behavior
No leaks can occur due to reasonable uses of this class.
Actual behavior
A leak occurs.
Environment
Additional context
This issue was inspired by nodejs/node#17469 (comment), see which for details.
The text was updated successfully, but these errors were encountered: