Browse Source

cluster: don't silently drop messages when the write queue gets big

v0.8.7-release
Bert Belder 13 years ago
parent
commit
bb2ce1a108
  1. 8
      lib/child_process.js

8
lib/child_process.js

@ -117,11 +117,6 @@ function setupChannel(target, channel) {
if (!target._channel) throw new Error("channel closed");
// For overflow protection don't write if channel queue is too deep.
if (channel.writeQueueSize > 1024 * 1024) {
return false;
}
var buffer = Buffer(JSON.stringify(message) + '\n');
if (sendHandle && setSimultaneousAccepts) {
@ -137,7 +132,8 @@ function setupChannel(target, channel) {
writeReq.oncomplete = nop;
return true;
/* If the master is > 2 read() calls behind, please stop sending. */
return channel.writeQueueSize < (65536 * 2);
};
channel.readStart();

Loading…
Cancel
Save