After a mail with Jean-Luc Rochat [[EMAIL PROTECTED]] I have arranged the vmtimeout logic. http://java.apache.org/jserv/upgrade.html says: ApJServVMTimeout The sample configuration files now have an entry for this setting. It is the amount of time to give the VM to start up as well as the amount of time between pings. If it takes longer than N number of seconds to get a response from the JVM, then restart it. Busy or slow servers should increase this setting. I have noticed that the ping occurs each 3 seconds, and that a timeout have nothing to do with a test frequency. I have arranged the logic so that it behaves like: ApJServVMTimeout The sample configuration files now have an entry for this setting. It is the amount of time to give the VM to start up as well as the timeout of the JVM to answer to a ping. If it takes longer than N number of seconds to get a response from the JVM, then restart it. Busy or slow servers should increase this setting. ApJServVMPing It is the amount of time between pings. The JVM uses cpu time and stable JVM applications never hang. The value should be adapted to the state of the java servlet application (some minutes in productive systems and seconds in test environments). My JVM hangs when it reaches its maximal allowed cpu time for the user, it does not answer to signal SIGTERM, only to SIGKILL, but the code of jserv_wrapper_unix was buggy - It creates defunct processes - I have also fixed the number of parameters in os_init_environment - one parameter was missing - Jean-Frédéric Clère EP LP DC22 (BCN) Fujitsu Siemens Computers Phone + 34 93 480 4209 Fax + 34 93 480 4201 Mail mailto:[EMAIL PROTECTED] Below are the patches needed for the corrections (sources from last week): --- src/c/jserv_wrapper_unix.c Thu Oct 28 03:17:01 1999 +++ src/c/jserv_wrapper_unix.c Tue Feb 22 12:43:54 2000 @@ -121,7 +121,10 @@ sleep(1); } if( waitpid(jvm_pid,NULL,WNOHANG)==0 ) { + jserv_error(JSERV_LOG_INFO, wrapper_data->config, + "wrapper: kill (SIGKILL) Java VM [%d]", jvm_pid); kill(jvm_pid, SIGKILL); + waitpid(jvm_pid,NULL,0); /* if it does not died, KERNEL bug! */ } jvm_pid=0; } @@ -297,7 +300,7 @@ /* Change uid to the server's User, if appropriate */ if ( #ifdef _OSD_POSIX - os_init_job_environment(cfg->config->server, ap_user_name) != 0 || + os_init_job_environment(cfg->config->server, ap_user_name,0) != 0 || #endif setuid(cfg->config->server->server_uid) == -1) { @@ -425,11 +428,12 @@ } last_restart = time(NULL); sleep(wrapper_data->config->vmtimeout); + continue; } } /* delay before rechecking for jvm */ - sleep(3); + sleep(wrapper_data->config->vmpingtime); } } --- src/c/jserv.h.in Tue Nov 30 23:11:16 1999 +++ src/c/jserv.h.in Wed Mar 8 10:46:55 2000 @@ -178,6 +178,7 @@ jserv_config *next; /* Next server strucure in servers chain*/ int retryattempts; /* Number of times to attempt to connect */ int vmtimeout; /* Seconds to give the JVM to start/stop */ + int vmpingtime; /* Seconds between the pings */ }; /* ========================================================================= */ --- src/c/mod_jserv.c Tue Nov 30 23:11:16 1999 +++ src/c/mod_jserv.c Tue Feb 22 12:49:46 2000 @@ -331,6 +331,7 @@ cfg->retryattempts=0; cfg->vmtimeout=JSERV_DEFAULT_VMTIMEOUT; + cfg->vmpingtime=JSERV_DEFAULT_VMTIMEOUT; /* We created the server config */ return(cfg); @@ -464,6 +465,7 @@ } cfg->retryattempts = base->retryattempts; cfg->vmtimeout = base->vmtimeout; + cfg->vmpingtime = base->vmpingtime; /* All done */ return (cfg); @@ -1211,6 +1213,18 @@ } /*************************************************************************** ** + * Handle ApJServVMPingTime directive (TAKE1) * + **************************************************************************** */ +static const char *jserv_cfg_setvmpingtime(cmd_parms *cmd, void *dummy, + char *num) { + server_rec *s = cmd->server; + jserv_config *cfg = jserv_server_config_get(s); + cfg->vmpingtime = atoi(num); + if (cfg->vmpingtime < 3) cfg->vmpingtime = 3; + return NULL; +} + +/************************************************************************** *** * Apache Module procedures * **************************************************************************** */ @@ -1660,6 +1674,8 @@ "Apache JServ: retry attempts (1s appart) before returning server error"}, {"ApJServVMTimeout", jserv_cfg_setvmtimeout, NULL, RSRC_CONF, TAKE1, "Apache JServ: the amount of time given for the JVM to start or stop"}, + {"ApJServVMPingTime", jserv_cfg_setvmpingtime, NULL, RSRC_CONF, TAKE1, + "Apache JServ: the amount of time between the pings to JVM"}, {NULL} }; --- src/c/jserv_wrapper.c Wed Jan 12 02:37:32 2000 +++ src/c/jserv_wrapper.c Tue Feb 22 12:47:44 2000 @@ -749,6 +749,7 @@ /* these are used only by the wrapper */ wrapper_data->config->vmtimeout=cfg->vmtimeout; wrapper_data->config->retryattempts=cfg->retryattempts; + wrapper_data->config->vmpingtime=cfg->vmpingtime; /* This is the only jserv_config element */ wrapper_data->config->next=NULL; -- ---------------------------------------------------------- To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Archives and Other: <http://java.apache.org/main/mail.html> Problems?: [EMAIL PROTECTED]