Author: rjung
Date: Tue Mar 10 00:15:48 2009
New Revision: 751917

URL: http://svn.apache.org/viewvc?rev=751917&view=rev
Log:
Use new attribute error_escalation_time to decide,
whether an unspecified local error should be
escalated to a global error. Decision is based on
how long we already have a local error.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=751917&r1=751916&r2=751917&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Tue Mar 10 00:15:48 
2009
@@ -1341,15 +1341,17 @@
                      * Service failed !!!
                      * Time for fault tolerance (if possible)...
                      */
+                    time_t now = time(NULL);
                     rec->s->errors++;
-                    if (rec->s->busy) {
-                        rec->s->state = JK_LB_STATE_OK;
-                    }
-                    else {
+                    if (rec->s->busy == 0 ||
+                        (rec->s->error_time > 0 &&
+                         (int)difftime(now, rec->s->error_time) >= 
p->worker->error_escalation_time)) {
                         rec->s->state = JK_LB_STATE_ERROR;
                     }
                     p->states[rec->i] = JK_LB_STATE_ERROR;
-                    rec->s->error_time = time(NULL);
+                    if (rec->s->error_time == 0) {
+                        rec->s->error_time = now;
+                    }
                     rc = JK_FALSE;
                 }
                 if (p->worker->lblock == JK_LB_LOCK_PESSIMISTIC)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to