Skip to content

Commit a6ae4e9

Browse files
committed
Set low priority for dump watchers
1 parent 347c1a7 commit a6ae4e9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/node_io_watcher.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ void IOWatcher::Initialize(Handle<Object> target) {
5252

5353
ev_prepare_init(&dumper, IOWatcher::Dump);
5454
ev_prepare_start(EV_DEFAULT_UC_ &dumper);
55+
// Need to make sure that Dump runs *after* all other prepare watchers -
56+
// in particular the next tick one.
57+
ev_set_priority(&dumper, EV_MINPRI);
5558
ev_unref(EV_DEFAULT_UC);
5659

5760
dump_queue = Persistent<Object>::New(Object::New());
@@ -200,10 +203,8 @@ Handle<Value> IOWatcher::Set(const Arguments& args) {
200203
// 'build/c4che/default.cache.py' and
201204
// make clean all
202205
#ifdef DUMP_DEBUG
203-
#define DEBUG_PRINT(fmt,...) do { \
204-
fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
205-
fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
206-
} while (0)
206+
#define DEBUG_PRINT(fmt,...) \
207+
fprintf(stderr, "%s:%d " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
207208
#else
208209
#define DEBUG_PRINT(fmt,...)
209210
#endif

test/pummel/test-dumper2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ function test (N, size, cb) {
2828
// Count the data as it arrives on the read end of the pipe.
2929
stream.on('data', function (d) {
3030
nread += d.length;
31-
process.stdout.write(".");
3231

3332
if (nread >= expected) {
3433
assert.ok(nread === expected);
@@ -88,6 +87,7 @@ function runTests (values) {
8887

8988
runTests([ [30, 1000]
9089
, [4, 10000]
90+
, [50, 1024*1024]
9191
]);
9292

9393

0 commit comments

Comments
 (0)