Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Unknown system errno 110 on afterConnect #2236

Closed
jhartikainen opened this issue Nov 30, 2011 · 12 comments
Closed

Unknown system errno 110 on afterConnect #2236

jhartikainen opened this issue Nov 30, 2011 · 12 comments

Comments

@jhartikainen
Copy link

On node v0.6.3, I'm encountering the following:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
          ^
Error: connect Unknown system errno 110
    at errnoException (net.js:614:11)
    at Object.afterConnect [as oncomplete] (net.js:605:18)

As far as I can tell, the issue happens somewhat randomly when some servers my application is connecting to are not responding for some reason or another.

This issue was supposedly fixed, see bnoordhuis' comment here:
#2121

Ubuntu 10.04 LTE, node 0.6.3

@bnoordhuis
Copy link
Member

Thanks for the report. Question: did you install Node from source or a PPA? If it's from source, can you do a make distclean and rebuild? Sometimes the bundled libuv doesn't get recompiled after a git pull / git checkout.

@jhartikainen
Copy link
Author

It was from source. I will do a distclean and rebuild, however it may take some time before this issue reappears.

@jhartikainen
Copy link
Author

Just ran into it again. Seems distclean/rebuild had no effect.

@bnoordhuis
Copy link
Member

Do you have a test case I can try? (I realize that may be difficult for 'once in a million' type of errors.)

@jhartikainen
Copy link
Author

I was able to reproduce this using:

var net = require('net');

var c = net.createConnection(6667, 'underworld1.no.quakenet.org');
c.on('connect', function() {
    console.log('Connected');
});

It seems that server is having some connection issues, but I don't know how long it's going to last (they will probably fix the server at some point, after which I doubt this specific case will trigger it anymore).

In any case, it seems like if the connection is disconnected before it's opened fully, the error is thrown, because I didn't get the "connected" message when it was failing.

@jameshartig
Copy link

This is easy to reproduce:
https://gist.github.com/1425471

This doesn't seem to be a bug though. The system is throwing the error 110 on timeout. The same thing happens when the keep-alive probes cause the system to determine that the socket is dead. Maybe we should detect this better and possibly emit 'timeout', but I'm against doing that as this is an error in terms of node.

If you run watch on netstat with --timers, then you see that it sends a SYN_SENT but never gets a reply and the system has a timeout that kills it.

@jhartikainen
Copy link
Author

The issue is that the error handler is not invoked for this, making it impossible to catch the error except by using a uncaughtException handler. That is at least what is happening on my end.

edit: I ran the code in your gist, and the error handler catches it, but when it happens in my app, it just skips the handler. I wish I knew why...

@jameshartig
Copy link

If you look at my gist, the error handler is being called for me with v0.6.4 and its dumping:
{ [Error: connect Unknown system errno 110]
code: 'Unknown system errno 110',
errno: 'Unknown system errno 110',
syscall: 'connect' }

@bnoordhuis
Copy link
Member

Confirmed, I can reproduce it with @fastest963's test case. Will fix.

@bnoordhuis
Copy link
Member

Fixed in joyent/libuv@248ca5d and a0fdd5f.

@ssssssssssss
Copy link

Can reproduce this issue in 0.6.5, so it will be included in next release?

@bnoordhuis
Copy link
Member

Can reproduce this issue in 0.6.5, so it will be included in next release?

Yes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants