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

Revert "handle_wrap: IsRefed -> Unrefed, no isAlive check" #6382

Closed
wants to merge 1 commit into from

Conversation

Fishrock123
Copy link
Contributor

original PR: #6204

subsystem: OOPS

this may be necessary... looks like getting the flags isn't possible if the flag isn't alive because that's literally a nullptr check..

static inline bool IsAlive(const HandleWrap* wrap) {
  return wrap != nullptr && wrap->GetHandle() != nullptr;
}

cc @trevnorris I guess

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Apr 26, 2016
@Fishrock123 Fishrock123 added this to the 6.0.0 milestone Apr 26, 2016
@Fishrock123 Fishrock123 mentioned this pull request Apr 26, 2016
@jasnell
Copy link
Member

jasnell commented Apr 26, 2016

Were there two that needed to be reverted? Or does this PR revert both?

@Fishrock123
Copy link
Contributor Author

No, this reverts only one.

@Fishrock123
Copy link
Contributor Author

@jasnell I'd like to leave time for @trevnorris to investigate, since he originally thought the patch would be ok.

@jasnell
Copy link
Member

jasnell commented Apr 26, 2016

yep. we've got time. I'll be rebasing several times off master and will be looking to cut the actual release tomorrow morning around 10:00am pacific.

@jasnell
Copy link
Member

jasnell commented Apr 26, 2016

@Fishrock123 @trevnorris .. what is the status on this and the other one that would need to be reverted?

@Fishrock123 Fishrock123 deleted the revert-9bb5a5e branch April 26, 2016 16:06
Fishrock123 added a commit to Fishrock123/node that referenced this pull request Apr 26, 2016
Fishrock123 added a commit to Fishrock123/node that referenced this pull request Apr 26, 2016
Fishrock123 added a commit to Fishrock123/node that referenced this pull request Apr 26, 2016
Fishrock123 added a commit to Fishrock123/node that referenced this pull request May 3, 2016
This reverts commit 9bb5a5e.

Refs: nodejs#6395
Refs: nodejs#6204
Refs: nodejs#6401
Refs: nodejs#6382
Fixes: nodejs#6381

Conflicts:
	src/handle_wrap.cc
	test/parallel/test-handle-wrap-isrefed-tty.js
	test/parallel/test-handle-wrap-isrefed.js
Fishrock123 added a commit to Fishrock123/node that referenced this pull request May 11, 2016
This reverts commit 9bb5a5e.

This API is not suitable because it depended on being able to
potentially access the handle's flag after the handle was already
cleaned up. Since this is not actually possible (obviously, oops)
this newer API no longer makes much sense, and the older API is more
suitable.

API comparison:
IsRefed -> Has a strong reference AND is alive. (Deterministic)
Unrefed -> Has a weak reference OR is dead. (Less deterministic)

Refs: nodejs#6395
Refs: nodejs#6204
Refs: nodejs#6401
Refs: nodejs#6382
Fixes: nodejs#6381

PR-URL: nodejs#6546
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	src/handle_wrap.cc
	test/parallel/test-handle-wrap-isrefed-tty.js
	test/parallel/test-handle-wrap-isrefed.js
Fishrock123 added a commit to Fishrock123/node that referenced this pull request May 11, 2016
Rename slightly to HasRef() at bnoordhuis’ request.
Better reflects what we actually do for this check.

Refs: nodejs#6395
Refs: nodejs#6204
Refs: nodejs#6401
Refs: nodejs#6382
Refs: nodejs#6381

PR-URL: nodejs#6546
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
evanlucas pushed a commit that referenced this pull request May 17, 2016
This reverts commit 9bb5a5e.

This API is not suitable because it depended on being able to
potentially access the handle's flag after the handle was already
cleaned up. Since this is not actually possible (obviously, oops)
this newer API no longer makes much sense, and the older API is more
suitable.

API comparison:
IsRefed -> Has a strong reference AND is alive. (Deterministic)
Unrefed -> Has a weak reference OR is dead. (Less deterministic)

Refs: #6395
Refs: #6204
Refs: #6401
Refs: #6382
Fixes: #6381

PR-URL: #6546
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	src/handle_wrap.cc
	test/parallel/test-handle-wrap-isrefed-tty.js
	test/parallel/test-handle-wrap-isrefed.js
evanlucas pushed a commit that referenced this pull request May 17, 2016
Rename slightly to HasRef() at bnoordhuis’ request.
Better reflects what we actually do for this check.

Refs: #6395
Refs: #6204
Refs: #6401
Refs: #6382
Refs: #6381

PR-URL: #6546
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants