Said test relies a great deal on internals and implementation details (I should
know, I wrote it). Patch it up to work with libuv's new refcounting scheme.
In case a worker would spawn a new subprocess with process.env, NODE_UNIQUE_ID
would have been a part of the env. Making the new subprocess believe it is a
worker, this would result in some confusion if the subprocess where to listen to
a port, since the server handle request would then be relayed to the worker.
This patch removes the NODE_UNIQUE_ID flag from process.env on startup so any
subprocess spawned by a worker is a normal process with no cluster stuff.
There are some paths here that led to dangling contexts. By being smarter with
handle management we can get rid of all the cleanup code and fix those issues.
This is a backport of commit 7063575.
request.end() would sometimes try to write a zero-length buffer to the socket.
Don't do that, it triggers an unnecessary EPIPE when the other end has closed
the connection.
Fixes#3257.
Before this commit, process._getActiveHandles() returned a list of internal
handles. Now, it returns the user objects that handles are attached to.
For example, a tcp_wrap handle will now return its parent net.Socket object.
It works for all handle types except timers because timer handles are shared
across multiple user objects.
* process._getActiveHandles() returns a list containing all active handles
(timers, sockets, etc.) that have not been unref'd.
* process._getActiveRequests() returns a list of active requests (in-flight
actions like connecting to a remote host, writing data to a socket, etc.).
Share persistent strings process_symbol and domain_symbol across compilation
units. Avoids redefinition errors when src/node.cc includes src/req_wrap.h.