-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use of WeakRef for resource #84
Comments
The documentation states the following about storing a resource in a
I am not quite sure if this would prevent us from using a If you have a reproducible case could you share it here? Preferably a small code example that does not rely on external dependencies that we could use for testing. |
Looks like MDN also explicitly states that a |
This seems promising though:
Let's give this a try. |
Closes mafintosh#84 Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops I've tested the change and it haven't solved an issue. But then I've realized, that when I was experimenting with this change myself, I also removed stack-trace capturing code and it turned out to be the culprit as well. So hard reference was stored in map directly in resource field, as well as in stack trace frames. Can't be sure that every stack trace will expose such problems, but in attached sample app it is. I've created commit that changes stack trace capturing code and stores only line number + filename: betalb@5b6c964 And the sample-app.tar.gz, it can be launched with Version of node that I was using |
Is it possible to use WeakRef for storing reference to resource?
I've observed one issue with undici library that relies on FinalizationRegistry to call destroy of async resource, but why-is-node-running is keeping strong reference to resource, preventing it from being garbage collected and destroyed.
The text was updated successfully, but these errors were encountered: