async_wrap: clear destroy_ids vector#10400
Merged
trevnorris merged 1 commit intonodejs:masterfrom Dec 22, 2016
Merged
Conversation
This was referenced Dec 21, 2016
Contributor
Author
|
All failing AIX tests not related to this change. |
bnoordhuis
approved these changes
Dec 22, 2016
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
Left a suggestion but LGTM either way.
src/async-wrap.cc
Outdated
Member
There was a problem hiding this comment.
Can I suggest you swap before iteration? I.e.:
std::vector<int64_t> destroy_ids_list;
destroy_ids_list.swap(*env->destroy_ids_list());
for (auto current_id : destroy_ids_list) {
// ...
}That way the list is both cleared and immune to concurrent modification by the callback.
19b54ae to
dd49d82
Compare
After processing all the callbacks in the destroy_ids vector make sure to clear() it otherwise the DestroyIdsCb() won't run again. PR-URL: nodejs#10400 Fixes: b49b496 "async_wrap: call destroy() callback in uv_idle_t" Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
dd49d82 to
833294f
Compare
trevnorris
added a commit
that referenced
this pull request
Dec 22, 2016
After processing all the callbacks in the destroy_ids vector make sure to clear() it otherwise the DestroyIdsCb() won't run again. PR-URL: #10400 Fixes: b49b496 "async_wrap: call destroy() callback in uv_idle_t" Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Contributor
Author
|
Thank you. Merged, and landed on v7.x-staging in 81a6dd5. @thealphanerd This should land in v6.x before the next release, if possible. I'll wait until this lands on v6, then prep both this and #9174 for v4. |
evanlucas
pushed a commit
that referenced
this pull request
Jan 3, 2017
After processing all the callbacks in the destroy_ids vector make sure to clear() it otherwise the DestroyIdsCb() won't run again. PR-URL: #10400 Fixes: b49b496 "async_wrap: call destroy() callback in uv_idle_t" Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins
pushed a commit
that referenced
this pull request
Jan 23, 2017
After processing all the callbacks in the destroy_ids vector make sure to clear() it otherwise the DestroyIdsCb() won't run again. PR-URL: #10400 Fixes: b49b496 "async_wrap: call destroy() callback in uv_idle_t" Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Contributor
|
@trevnorris this has been backported to v6.x and will be in the next release |
MylesBorins
pushed a commit
that referenced
this pull request
Jan 24, 2017
After processing all the callbacks in the destroy_ids vector make sure to clear() it otherwise the DestroyIdsCb() won't run again. PR-URL: #10400 Fixes: b49b496 "async_wrap: call destroy() callback in uv_idle_t" Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
Jan 31, 2017
After processing all the callbacks in the destroy_ids vector make sure to clear() it otherwise the DestroyIdsCb() won't run again. PR-URL: #10400 Fixes: b49b496 "async_wrap: call destroy() callback in uv_idle_t" Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
async_wrapDescription of change
After processing all the callbacks in the destroy_ids vector make sure
to clear() it otherwise the DestroyIdsCb() won't run again.
This patch should land on all releases that have b49b496, or some cherry-pick of it.
CI: https://ci.nodejs.org/job/node-test-commit/6782/