hgomez 01/06/18 01:32:22
Modified: jk/native/common jk_lb_worker.c
Log:
This patch changes the behavior by pre-initializing lb_value for each
worker. The selection algorithm searches for the worker with the lowest
lb_value that is not in a failed state. It then increments the lb_value
by the lb_factor. lb_factor is set to the inverse (1/x) of the
lb_factor specified in the config file. When lb_factor in the config
file is 0, this number becomes basically MAX_DOUBLE. That means that
lb_value becomes MAX_DOUBLE, so it will never be selected for any
practical purposes.
Obtained from: Paul Frieden <[EMAIL PROTECTED]>
Revision Changes Path
1.3 +8 -2 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jk_lb_worker.c 2001/06/12 06:26:25 1.2
+++ jk_lb_worker.c 2001/06/18 08:32:18 1.3
@@ -58,7 +58,7 @@
* several workers. *
* Author: Gal Shachor <[EMAIL PROTECTED]> *
* Based on: *
- * Version: $Revision: 1.2 $ *
+ * Version: $Revision: 1.3 $ *
***************************************************************************/
#include "jk_pool.h"
@@ -427,7 +427,13 @@
p->lb_workers[i].lb_factor = jk_get_lb_factor(props,
worker_names[i]);
p->lb_workers[i].lb_factor = 1/p->lb_workers[i].lb_factor;
- p->lb_workers[i].lb_value = 0.0;
+ /*
+ * Allow using lb in fault-tolerant mode.
+ * Just set lbfactor in worker.properties to 0 to have
+ * a worker used only when principal is down or session route
+ * point to it. Provided by Paul Frieden <[EMAIL PROTECTED]>
+ */
+ p->lb_workers[i].lb_value = p->lb_workers[i].lb_factor;
p->lb_workers[i].in_error_state = JK_FALSE;
p->lb_workers[i].in_recovering = JK_FALSE;
if(!wc_create_worker(p->lb_workers[i].name,