From 04dd2d51be03c01d9ab259fe40e436730778bd01 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 4 Jan 2010 23:26:58 -0800 Subject: [PATCH] libeio bugfix: want_poll should be called if breaking on maxreq Reported by shansen and hassox http://github.com/ry/node/issues#issue/38 Will send upstream. --- deps/libeio/eio.c | 3 +++ test/mjsunit/test-many-parallel-eio-jobs.js | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/mjsunit/test-many-parallel-eio-jobs.js diff --git a/deps/libeio/eio.c b/deps/libeio/eio.c index 7d54ca9..9f53692 100644 --- a/deps/libeio/eio.c +++ b/deps/libeio/eio.c @@ -548,6 +548,9 @@ static int etp_poll (void) } } + if (want_poll_cb) + want_poll_cb (); + errno = EAGAIN; return -1; } diff --git a/test/mjsunit/test-many-parallel-eio-jobs.js b/test/mjsunit/test-many-parallel-eio-jobs.js new file mode 100644 index 0000000..c52c814 --- /dev/null +++ b/test/mjsunit/test-many-parallel-eio-jobs.js @@ -0,0 +1,20 @@ +process.mixin(require("./common")); +var testTxt = path.join(fixturesDir, "x.txt"); +var posix = require('posix'); + +setTimeout(function () { + // put this in a timeout, just so it doesn't get bunched up with the + // require() calls.. + N = 30; + for (var i=0; i < N; i++) { + puts("start " + i); + posix.cat(testTxt).addCallback(function(data) { + puts("finish"); + }).addErrback(function (e) { + puts("error! " + e); + process.exit(1); + }); + } +}, 100); + + -- 2.7.4