Skip to content

Conversation

@danbev
Copy link
Contributor

This pull request contains two commits as the latter depends on the former.
I can make these separate if needed.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [z] commit message follows commit guidelines
Affected core subsystem(s)

src

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. c++ Issues and PRs that require attention from people who are familiar with C++. tools Issues and PRs related to the tools directory. v7.x labels Apr 26, 2017
@addaleax
Copy link
Member

@danbev Do you want to wait for a resolution on #12621 (comment)?

@danbev
Copy link
ContributorAuthor

@danbev Do you want to wait for a resolution on #12621 (comment)?

Yes, that makes sense. For some reason I did not notice that issue before. Thanks

@addaleax
Copy link
Member

@danbev Do you want to cherry-pick d5db4d2 in here?

@danbev
Copy link
ContributorAuthor

@danbev Do you want to cherry-pick d5db4d2 in here?

Absolutely, I'll do that first thing tomorrow.

This commit tries to make it simpler to add unit tests (cctest) for code that needs to test node core funtionality but that might not be appropriate as an addon or a JavaScript test. An example of this could be adding functionality targeted for situations when Node itself is embedded. Currently it was not as easy, or efficient, as one would have hoped to add such tests. The object output directories vary for different operating systems which we need to link to so that we don't have an additional compilation step. PR-URL: nodejs#11956 Ref: nodejs#9163 Reviewed-By: James M Snell <[email protected]>
@danbevdanbevforce-pushed the v7.x-at-exit-per-environment branch from 79f550f to ed545beCompareMay 2, 2017 05:23
bnoordhuisand others added 3 commits May 2, 2017 07:23
It makes timers and other libuv handles fire intermittently after the 'exit' event, contrary to what the documentation states. Regression introduced in commit aac79df ("src: use stack-allocated Environment instances") from June last year that made the `while (handle_cleanup_waiting_ != 0) uv_run(event_loop(), UV_RUN_ONCE)` loop run unconditionally on exit because it merged CleanupHandles() into the Environment destructor. This change breaks parallel/test-async-wrap-throw-from-callback because the async_wrap idle handle is no longer cleaned up, which I resolved pragmatically by removing the test. In all seriousness, it is being removed in the upcoming async_wrap revamp - it doesn't make sense to sink a lot of time in it now. Fixes: nodejs#12322 PR-URL: nodejs#12344 Reviewed-By: Colin Ihrig <[email protected]>
This commit attempts to address one of the TODOs in nodejs#4641 regarding making the AtExit callback's per environment, instead of the current global. bnoordhuis provided a few options for solving this, and one was to use a thread-local which is what this commit attempts to do. PR-URL: nodejs#9163 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
The test fixtures create multiple node::Environments that all use the uv_default_loop(), and since the test does not clean up the handles created by Environment::Start(), the default libuv loop structure contains dangling pointers after the first Environment is freed, which then means that creating new handles leads to memory corruption. PR-URL: nodejs#12621 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
@danbev
Copy link
ContributorAuthor

@gibfahn
Copy link
Member

I don't think this is going to land 😢 , closing.

@gibfahngibfahn closed this Jun 18, 2017
@danbevdanbev deleted the v7.x-at-exit-per-environment branch February 28, 2018 07:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.c++Issues and PRs that require attention from people who are familiar with C++.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@danbev@addaleax@gibfahn@nodejs-github-bot@bnoordhuis