net_uv.js throws assertion error #1697

Closed
randyho-kk opened this Issue Sep 13, 2011 · 10 comments

Projects

None yet

7 participants

@randyho-kk

Node Version

Windows node.exe v0.5.6

Problem

Occasional AssertionError when using Socket.IO. This makes the windows version of node.js unusable.


←[31m[2011-08-30 14:26:28.742] [ERROR] console - ←[39mAssertionError: {"oncomple
te":"function afterWrite(status, handle, req, buffer) {\n  var self = handle.soc
ket;\n\n  // callback may come after c == {"oncomplete":"function afterWrite(sta
tus, handle, req, buffer) {\n  var self = handle.socket;\n\n  // callback may co
me after c
    at Object.afterWrite [as oncomplete] (net_uv.js:414:10)

@bnoordhuis
Member

Yes, known bug but hard to reproduce reliably. The write requests come back in a different order than what they're sent off in.

@bnoordhuis bnoordhuis was assigned Sep 13, 2011
@piscisaureus
Member

On windows, this is probably caused by write requests short-circuiting while a previous write has completed but is still in the IOCPs queue.

@ry
ry commented Sep 17, 2011

reverted @piscisaureus test case in cde81a6 - it was causing other tests to fail

@Pita
Pita commented Sep 26, 2011

+1

@JohnMcLear

This is pretty important to me too

@ry ry added a commit that referenced this issue Sep 26, 2011
@ry ry Re-land Bert's test for #1697
Was reverted out in cde81a6
040cf02
@ry
ry commented Sep 30, 2011

@piscisaureus any update on this? we're passing this in unix-land

@bnoordhuis
Member

test/simple/test-regress-GH-1697.js sometimes fails (and leaves behind a child process) with make test.

Error: connect ECONNREFUSED
    at errnoException (net_uv.js:566:11)
    at Object.afterConnect [as oncomplete] (net_uv.js:557:18)
Command: out/Release/node /home/bnoordhuis/src/nodejs/node/test/simple/test-regress-GH-1697.js

Probably a timing issue.

@rukeba
rukeba commented Oct 5, 2011

The bug appears in v.0.5.8 too. It reproduced easy when send long responses (1Mb, chunked or with Content-Length):

function long_response(request, response) {
    var l = 1000;
    var s = '';
    for(var j=0; j<100; j++){
        s += '0123456789';
    }
    response.writeHead(200, {"Content-Type": "text/plain"});
    for(var i=0; i<l; i++){
        response.write(s);
    }
    response.end();
}
@piscisaureus
Member

Fixed in ed65b7b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment