I’ve got a simple tracking app running on Node.JS which basically parses the URL it’s given and returns a 1×1 pixel gif image. A couple of times per day I get the following error in the log:
Error: Socket is not writable
at Socket._writeOut (net.js:391:11)
at Socket.write (net.js:377:17)
at ServerResponse._writeRaw (http.js:392:28)
at ServerResponse._send (http.js:372:15)
at ServerResponse.write (http.js:622:16)
at ServerResponse.end (http.js:682:16)
at /var/www/app.js:221:7
at Server.<anonymous> (/var/www/app.js:234:3)
at Server.emit (events.js:67:17)
at HTTPParser.onIncoming (http.js:1124:12)
I have absolutely no clue what’s causing this. Any ideas where to look? (it happens on different UAs although until now I’ve only seen it happen when the request is coming from a Windows machine but considering the vast majority of machines is Windows this doesn’t have to mean anything).
You should file a bug to https://github.com/joyent/node/issues?state=open
It could be a violation of the usual stream write protocol in your module or in system HTTP module: if write() fails, wait for drain() event. So you should look for failed writes in your code and HTTP javascript module compiled into /usr/bin/node binary and double-check that drain waiting is obeyed. Drain events are rare, so it’s possible that this bug has been unnoticed for a long time.