You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/01/12 06:27:39 UTC
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_lb_worker.c
costin 02/01/11 21:27:39
Modified: jk/native build.xml
jk/native/common jk_lb_worker.c
Log:
Few changes to make it build on hpux.
A small fix in lb worker - try once more to connect to the host
where the session is located before giving up. This should solve
a lb bug which may happen in some cases.
Revision Changes Path
1.27 +9 -1 jakarta-tomcat-connectors/jk/native/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/build.xml,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- build.xml 4 Jan 2002 05:13:31 -0000 1.26
+++ build.xml 12 Jan 2002 05:27:39 -0000 1.27
@@ -80,7 +80,8 @@
<include name="${novellndk.dir}/include/nlm" if="netware" />
<include name="${novellndk.dir}/include" if="netware" />
<include name="${java.home}/../include/netware" if="netware" />
-
+ <include name="${java.home}/../include/hp-ux" if="hpux" />
+ <include name="${java.home}/../include/linux" if="linux" />
<include name="${java.home}/../include/win32" if="win32" />
</includes>
<depends>
@@ -109,6 +110,8 @@
<linkOpt value="-threadname "JK_JNI Thread"" if="netware" />
<linkOpt value="-stacksize 64000" if="netware" />
+ <def name="HPUX11" if="hpux" />
+
<def name="WIN32" if="win32" />
<def name="DEBUG" if="win32.debug" />
<def name="NDEBUG" if="win32.release" />
@@ -140,6 +143,7 @@
info="Reuse the worker endpoint, using per thread data" />
<def name="USE_APACHE_MD5"
info="Use the MD5 implementation that is part of apache2" />
+ <def name="HPUX11" if="hpux" />
<apacheConfig apxs="${apxs20}" />
<jniConfig />
<src dir=".">
@@ -153,6 +157,7 @@
<include name="${apache2.include}" />
<include name="${java.home}/../include" />
<include name="${java.home}/../include/win32" if="win32" />
+ <include name="${java.home}/../include/hp-ux" if="hpux" />
</includes>
<depends>
<fileset dir="${native.dir}/common" includes="*.h" />
@@ -207,6 +212,7 @@
<include name="${apache13.home}/os/win32" if="win32" />
<include name="${java.home}/../include/win32" if="win32" />
+ <include name="${java.home}/../include/hp-ux" if="hpux" />
<include name="${native.dir}/common" if="win32" />
</includes>
<depends>
@@ -223,6 +229,8 @@
<def name="USE_SPRINTF" if="netware"
info="Use the sprintf function to build strings" />
+ <def name="HPUX11" if="hpux" />
+
<def name="WIN32" if="win32" />
<def name="DEBUG" if="win32.debug" />
<def name="NDEBUG" if="win32.release" />
1.8 +10 -5 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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- jk_lb_worker.c 4 Dec 2001 19:44:23 -0000 1.7
+++ jk_lb_worker.c 12 Jan 2002 05:27:39 -0000 1.8
@@ -60,7 +60,7 @@
* several workers. *
* Author: Gal Shachor <sh...@il.ibm.com> *
* Based on: *
- * Version: $Revision: 1.7 $ *
+ * Version: $Revision: 1.8 $ *
***************************************************************************/
#include "jk_pool.h"
@@ -246,7 +246,7 @@
}
static worker_record_t *get_most_suitable_worker(lb_worker_t *p,
- jk_ws_service_t *s)
+ jk_ws_service_t *s, int attempt)
{
worker_record_t *rc = NULL;
double lb_min = 0.0;
@@ -256,7 +256,11 @@
if(session_route) {
for(i = 0 ; i < p->num_of_workers ; i++) {
if(0 == strcmp(session_route, p->lb_workers[i].name)) {
- if(p->lb_workers[i].in_error_state) {
+ /* First attempt will allways be to the
+ correct host. If this is indeed down and no
+ hope of recovery, we'll go to fail-over
+ */
+ if(attempt>0 && p->lb_workers[i].in_error_state) {
break;
} else {
return &(p->lb_workers[i]);
@@ -305,13 +309,14 @@
if(e && e->endpoint_private && s && is_recoverable_error) {
lb_endpoint_t *p = e->endpoint_private;
jk_endpoint_t *end = NULL;
+ int attempt=0;
/* you can not recover on another load balancer */
*is_recoverable_error = JK_FALSE;
-
+
while(1) {
- worker_record_t *rec = get_most_suitable_worker(p->worker, s);
+ worker_record_t *rec = get_most_suitable_worker(p->worker, s, attempt++);
int rc;
if(rec) {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>