src: clean up resources on Environment teardown by addaleax · Pull Request #19377 · nodejs/node

@addaleax added semver-minor

PRs that contain new features and should be released in the next minor version.

lib / src

Issues and PRs related to general changes in the lib or src directory.

embedding

Issues and PRs related to embedding Node.js in another project.

worker

Issues and PRs related to Worker support.

labels

Mar 15, 2018

@nodejs-github-bot nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

lib / src

Issues and PRs related to general changes in the lib or src directory.

labels

Mar 15, 2018

joyeecheung

joyeecheung

@addaleax addaleax added the wip

Issues and PRs that are still a work in progress.

label

Mar 16, 2018

bnoordhuis

jasnell

jasnell

jasnell

yhwang

yhwang

addaleax added a commit that referenced this pull request

May 10, 2018
On Windows, we can't just look up a FD for libuv streams and
return it in `GetFD()`.
However, we do sometimes construct streams from their FDs;
in those cases, it should be okay to store the value on a class field.

PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

May 10, 2018
This currently crashes during environment cleanup because
the object would be torn down while there are enabled categories.

I’m not sure about the exact semantics here, but since the
object cannot be garbage collected at this point anyway
because it’s `Persistent` handle is strong, removing the
destructor at least doesn’t make anything worse than it is
right now (i.e. the destructor would never have been called
before anyway).

PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

May 10, 2018
This is done to match the stream implementation, which also
only actually stops reading in the next tick after the `'pause'`
event is emitted.

PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

May 10, 2018
For libuv-backed streams, always explicitly stop reading before
closing the handle.

PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax added a commit that referenced this pull request

May 10, 2018
Instead of using the libuv mechanism directly, provide an internal
`ThreadPoolWork` wrapper that takes care of increasing/decreasing
the waiting request counter.

PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

targos pushed a commit that referenced this pull request

May 12, 2018
Refs: #19377
PR-URL: #20585
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

@tmpfs tmpfs mentioned this pull request

Jun 18, 2018