mod_jk registers its cleanup handler to be called both during plain_cleanup and child_cleanup: apr_pool_cleanup_register(p, s, jk_apr_pool_cleanup, jk_apr_pool_cleanup); So, whenever a server forks a child, ie, when mod_cgi creates its child process, jk_apr_pool_cleanup() gets called. jk_apr_pool_cleanup() does a shutdown() on its sockets, which closes down the socket for the parent process. Maybe it should use close() instead of shutdown(), or be registered as apr_pool_cleanup_register(p, s, jk_apr_pool_cleanup, jk_apr_pool_cleanup_null); ? Note, with mod_jk 1.2.18, a load balancing worker isn't able to recover from this, and it brings down the whole LB worker for awhile. 1.2.27 seems to be able to recover. After a CGI is hit and jk's sockets get closed underneath it, the logs look like: [Wed Jan 28 21:39:50 2009] [22841:42432] [info] ajp_send_request::jk_ajp_common.c (1178): Socket 75 is not connected any more (errno=-1) [Wed Jan 28 21:39:50 2009] [22841:42432] [info] ajp_send_request::jk_ajp_common.c (1202): Error sending request. Will try another pooled connection [Wed Jan 28 21:39:50 2009] [22841:42432] [info] ajp_send_request::jk_ajp_common.c (1224): All endpoints are disconnected or dead [Wed Jan 28 21:39:50 2009] [22841:42432] [info] ajp_service::jk_ajp_common.c (1783): Sending request to tomcat failed, recoverable operation attempt=1
Fixed in the SVN. If needed the child cleanup certainly cannot be the same as standard pool cleanup we are using currently.
Will be part of 1.2.29.
Spam removal
Restoring the original value of OS/Version field.