When the ISAPI redirector is used to access a back-end server that doesn't respond to a request for a long time, IIS shutdown will be blocked. The specific case I've observed this is an Eclipse RAP application, with UI callbacks activated, which triggers a polling HTTP request to be made to the server - this request only returns when there are UI updates to display Debugging yields the stack trace below (note the line numbers will be a bit off from trunk at the moment): isapi_redirect.dll!jk_tcp_socket_recvfull(unsigned int sd=1188, unsigned char * b=0x0124e18c, int len=4, jk_logger * l=0x01205478) Line 896 + 0x1a bytes C isapi_redirect.dll!ajp_connection_tcp_get_message(ajp_endpoint * ae=0x012a41a8, jk_msg_buf_t * msg=0x012a41e0, jk_logger * l=0x01205478) Line 1216 + 0x19 bytes C isapi_redirect.dll!ajp_get_reply(jk_endpoint * e=0x012a61d8, jk_ws_service * s=0x0124f288, jk_logger * l=0x01205478, ajp_endpoint * p=0x012a41a8, ajp_operation * op=0x0124e21c) Line 2053 + 0x14 bytes C > isapi_redirect.dll!ajp_service(jk_endpoint * e=0x012a61d8, jk_ws_service * s=0x0124f288, jk_logger * l=0x01205478, int * is_error=0x0124e254) Line 2449 + 0x19 bytes C isapi_redirect.dll!HttpExtensionProc(_EXTENSION_CONTROL_BLOCK * lpEcb=0x00aced68) Line 2184 + 0x27 bytes C (This is the call to e->service after obtaining a worker). I've replicated this multiple times on shutdown with 1.2.30 and 1.2.27. This is observed even after terminating the browser.
I've just tested this with the ISAPI redirector 1.2.42 and Windows 2008 SP. The same behaviour is observed. The behaviour is related to the socket_timeout. By default this is infinite. Setting a lower timeout (e.g. 10s) enables IIS to shutdown cleanly. Note: With an infinite timeput IIS will shutdown eventually, but not until the back-end writes a response. Need to look to see if there is a way to interrupt / cancel the I/O on shut down.