tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r439812 - in /tomcat/connectors/trunk/jk/native/common: jk_lb_worker.c jk_shm.h
Date Sun, 03 Sep 2006 17:53:56 GMT
Author: rjung
Date: Sun Sep  3 10:53:55 2006
New Revision: 439812

URL: http://svn.apache.org/viewvc?view=rev&rev=439812
Log:
Setting back a worker during global maintenance in lb
from OK state to NA state, if no requests have been 
processed since the last global maintenance.
We cannot use last_access, since it is only updated
if a timeout is being configured.

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

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?view=diff&rev=439812&r1=439811&r2=439812
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sun Sep  3 10:53:55 2006
@@ -280,6 +280,9 @@
  * operational if the retry timeout is elapsed.
  * The worker might still be unusable, but we try
  * anyway.
+ * If the worker is in ok state and got no requests
+ * since the last global maintenance, we mark its
+ * state as not available.
  */
 static void recover_workers(lb_worker_t *p,
                             jk_uint64_t curmax,
@@ -310,6 +313,12 @@
                 w->s->state = JK_LB_STATE_RECOVER;
             }
         }
+        else {
+            if (w->s->state == JK_LB_STATE_OK &&
+                w->s->elected == w->s->elected_snapshot)
+                w->s->state = JK_LB_STATE_NA;
+        }
+        w->s->elected_snapshot = w->s->elected;
     }
 
     JK_TRACE_EXIT(l);

Modified: tomcat/connectors/trunk/jk/native/common/jk_shm.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_shm.h?view=diff&rev=439812&r1=439811&r2=439812
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_shm.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_shm.h Sun Sep  3 10:53:55 2006
@@ -98,6 +98,8 @@
     volatile jk_uint64_t transferred;
     /* Number of times the worker was elected */
     volatile jk_uint64_t  elected;
+    /* Number of times the worker was elected - snapshot during maintenance */
+    volatile jk_uint64_t  elected_snapshot;
     /* Number of non 200 responses */
     volatile jk_uint32_t  errors;
     /* Number of recovery attempts */



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


Mime
View raw message