mturk 2005/09/13 23:50:14 Modified: jk/native/common jk_lb_worker.c jk/xdocs changelog.xml Log: Fix lb for worker mpm's with cachesize set to lower number then ThreadsPerChild is. If retries is set to value larger then 3 sleep for 100 ms on each attempt. This enables to tune the connection cache, and serialize incoming connections instead returning busy if connection count is larger then cachesize. Revision Changes Path 1.93 +14 -6 jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c Index: jk_lb_worker.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- jk_lb_worker.c 12 Sep 2005 12:53:05 -0000 1.92 +++ jk_lb_worker.c 14 Sep 2005 06:50:14 -0000 1.93 @@ -652,13 +652,19 @@ * mark the worker as busy rather then * as in error */ - rec->s->is_busy = JK_TRUE; + if (p->worker->s->retries < num_of_workers) + rec->s->is_busy = JK_TRUE; jk_log(l, JK_LOG_INFO, - "could not get free endpoint for worker %s", - rec->s->name); + "could not get free endpoint for worker %s (attempt %d)", + rec->s->name, attempt); /* Decrement the worker count and try another worker */ - --num_of_workers; - prec = rec; + if (attempt > p->worker->s->retries) + num_of_workers = 0; + /* In case of retries > 3 sleep 100 ms + * on each next attempt. + */ + else if (attempt > JK_RETRIES) + jk_sleep_def(); continue; } if (service_stat == JK_FALSE) { @@ -725,6 +731,7 @@ jk_log(l, JK_LOG_DEBUG, "recoverable error... will try to recover on other host"); } +#if 0 else { /* NULL record, no more workers left ... */ jk_log(l, JK_LOG_ERROR, @@ -733,6 +740,7 @@ *is_error = JK_HTTP_SERVER_BUSY; return JK_FALSE; } +#endif --num_of_workers; prec = rec; } 1.42 +7 -0 jakarta-tomcat-connectors/jk/xdocs/changelog.xml Index: changelog.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/xdocs/changelog.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- changelog.xml 12 Sep 2005 14:29:49 -0000 1.41 +++ changelog.xml 14 Sep 2005 06:50:14 -0000 1.42 @@ -26,6 +26,13 @@ <subsection name="Native"> <changelog> <fix> + Fix lb for worker mpm's with cachesize set to lower number then + ThreadsPerChild is. If retries is set to value larger then 3 sleep for + 100 ms on each attempt. This enables to tune the connection cache, + and serialize incoming connections instead returning busy if connection + count is larger then cachesize. (mturk) + </fix> + <fix> <bug>36525</bug>: Solaris core dump. (mturk) </fix> <fix>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]