-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
When I set jbss.mod_cluster.proxyList (e.g.) to "http1.dyndns.org:8000,1.2.3.4:8000", mod-cluster does connect to http1.dyndns.org:8000 (assuming it's running), but blocks for 10 minutes trying to connect to 1.2.3.4:8000.
It eventually times out connecting to 1.2.3.4, and then seems to default to 127.0.0.1 !
A better mechanism would be to connect via a timeout (see code below), and to simply skip unreachable httpd instances. The reconnect mechanism can always add httpds (which become reachable) later.
The code to connect to a socket with a timeout would be:
Socket sock=new Socket(new InetSocketAddress("1.2.3.4", 8000), 1000);
This call blocks until it has connected to 1.2.3.4:8000, or until 1 sec has elapsed, whichever occurs first.
In any case, it doesn't block until the OS defined socket connect timeout kicks in; this might be up to 10 mins !