Hi,
 
we had a problem that the contexts were not properly removed if (and only if) tomcat was running as a Win NT service. (We are using the jk_nt_service.exe to control tomcat). (win NT4.0, Tomcat 3.2-b7, jdk 1.2.2_006)
 
This is due to a timing problem. In the stop_tomcat function (jk_nt_service.c module see below) the delay between sending the stop message to tomcat and the TerminateProcess system call was too short. Tomcat was not able to shutdown all contexts in time and was killed by jk_nt_service.exe. I increased the delay and everything worked fine.
 
Since I have no access to the CVS system I really would appreciate if anybody could review our changes and if approved insert into the cvs system! Therefor I attached the modified source file. 
 
-- Jochen
 
   
<sniplet>
 
            }
            jk_close_socket(sd);
            if(JK_TRUE == rc) {
               // if(WAIT_OBJECT_0 == WaitForSingleObject(hTomcat, 30*1000)) {

                // (JS 22.11.2000)
                // Extended wait time since the service needs some more time to shutdown properly and to remove all contexts
                if(WAIT_OBJECT_0 == WaitForSingleObject(hTomcat, 180*1000)) {
                    return;
                }
            }           
        }
    }
    TerminateProcess(hTomcat, 0);
</sniplet>
   
 

jk_nt_service.c

Reply via email to