Users too often would forget to add
socket.on('end', function () {
socket.end();
});
Which is a mistake. Therefore we default to this behavior and
only optionally let people handle the 'end' case themselves.
When a server hit EMFILE it would continue to try to accept new connections
from the queue. This patch introduces a timeout of one second where it will
stop trying to accept new files. After the second is over it tries again.
This is a rather serious bug that has been effecting many highly concurrent
programs. It was introduced in 4593c0, version v0.2.0.
TODO: A test for this situation. Currently I test it like this
termA% cd projects/node
termA% ulimit -n 256
termA% ./node benchmark/idle_server.js
termB% cd projects/node
termB% ./node benchmark/idle_clients.js
And watch how the server process behaves.
In order to do this, buffer data management was moved out of the
JS entry-point New, and into Replace.
Secondly, the constructor makes an immediate call to Replace, and
in order for ArrayData calls to work, wrapping must already be set
up. Now, the constructor takes the wrappee as a parameter.
v8 doesn't expose a command-line flag to set the stack size, so this
adds a new flag that node understands how to handle and uses v8's
ResourceConstraints API.
This way, the "default" paths of ~/.node_libraries and {prefix}/lib/node are only checked *after* anything that the user has placed into the NODE_PATHS environ, or pushed onto require.paths.
This makes require.paths a much more effective write-target, albeit slightly less useful as a read-target. However, given the existence of require.resolve(), this is less of an issue -- if you want to know what a module ID will map to, just ask that question and get an authoritative answer from the loading machinery.