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

test,n-api: delete strong ref w/o unrefing first #34822

Conversation

gabrielschulhof
Copy link
Contributor

Fixes: #34731
Signed-off-by: @gabrielschulhof

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 18, 2020
@gabrielschulhof gabrielschulhof added the node-api Issues and PRs related to the Node-API. label Aug 18, 2020
@addaleax
Copy link
Member

It's great that this fixes the test, but it still seems counterintuitive that unref'ing a reference can lead to a memory leak? I would not say that this "Fixes:" the issue.

@gabrielschulhof
Copy link
Contributor Author

@addaleax you're right. We should either document that strong references must not be weakened before getting deleted or figure out how to accommodate weakening them before deletion. I'll replace the "Fixes" with "Re".

Re: nodejs#34731
Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
@gabrielschulhof gabrielschulhof force-pushed the delete-strong-ref-without-unrefinf-first branch from a24d6ed to 2a8342e Compare August 18, 2020 16:34
@mhdawson
Copy link
Member

I agreed and unless there is some V8 level limitation I think it should be figure out how to accommodate weakening them before deletion.

@mhdawson
Copy link
Member

I'd also lean towards not landing this until we better understand the issue, as it provides the reminder that we need to fix the underlying problem.

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally okay with landing this, if you like.

(Edit: Btw, we use Refs: for referencing issues in commit messages almost universally at this point. The commit message linter might expect that as well, I’m not sure.)

@gabrielschulhof gabrielschulhof deleted the delete-strong-ref-without-unrefinf-first branch January 28, 2021 00:14
@gabrielschulhof gabrielschulhof restored the delete-strong-ref-without-unrefinf-first branch January 28, 2021 05:33
@gabrielschulhof gabrielschulhof deleted the delete-strong-ref-without-unrefinf-first branch February 3, 2021 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

N-API reference management leaks memory
4 participants