On Oct 9, 2008, at 4:26 AM, Ruediger Pluem wrote:



On 10/08/2008 10:55 PM, Matt Stevenson wrote:
Hi,

I've used mod_jk (1/2) for years. I've always had an issue when a backend server goes down, not tomcat/jboss stopped but dead. Recently some people I work with have been using mod_proxy and mod_proxy_ajp. This seems to have the same issue.

The code (proxy_util.c) assumes that apr_socket_timeout_set works for all connects. I don't believe it does, not unless it is in non blocking mode. I wrote the code below for"ap_proxy_connect_backend" before I looked deeper into the apr libs (sorry its not in diff format, and for the hard 2 sec timeout). The code seems to work fine for linux (and probably other unix). I've basically redone the apr code in apr_wait_for_io_or_timeout (should have dug deeper first).

Anyway the current release code doesn't seem to work for me for down boxes (to test point an ajp proxy at a non existant IP on the network and a live server). I think if you put the socket in non-blocking mode first and with a timeout apr will try to handle a connect timeout (I haven't had a chance to try), switch back to non blocking after connect.

Exactly. This might be the only thing missing in ap_proxy_connect_backend: Setting the socket to non blocking before calling apr_socket_connect and setting it to blocking again afterwards.


+1

Reply via email to