Author: rjung
Date: Sun Jun 24 07:56:17 2007
New Revision: 550241

URL: http://svn.apache.org/viewvc?view=rev&rev=550241
Log:
Renamed runtime states. No new states have been added to code.
All states have a major state (OK or ERR) and a substate.
Changed the name N/A to OK/IDLE.
Also added docs about the meaning of the states to the status worker
page in the reference guide.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
    tomcat/connectors/trunk/jk/native/common/jk_status.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
    tomcat/connectors/trunk/jk/xdocs/reference/status.xml

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=550241&r1=550240&r2=550241
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sun Jun 24 07:56:17 
2007
@@ -60,7 +60,7 @@
 };
 
 static const char *lb_state_type[] = {
-    JK_LB_STATE_TEXT_NA,
+    JK_LB_STATE_TEXT_IDLE,
     JK_LB_STATE_TEXT_OK,
     JK_LB_STATE_TEXT_RECOVER,
     JK_LB_STATE_TEXT_BUSY,
@@ -190,8 +190,8 @@
 {
     if (!v)
         return JK_LB_STATE_DEF;
-    else if  (*v == 'n' || *v == 'N' || *v == '0')
-        return JK_LB_STATE_NA;
+    else if  (*v == 'i' || *v == 'I' || *v == 'n' || *v == 'N' || *v == '0')
+        return JK_LB_STATE_IDLE;
     else if  (*v == 'o' || *v == 'O' || *v == '1')
         return JK_LB_STATE_OK;
     else if  (*v == 'r' || *v == 'R' || *v == '2')
@@ -454,7 +454,7 @@
             non_error++;
             if (w->s->state == JK_LB_STATE_OK &&
                 w->s->elected == w->s->elected_snapshot)
-                w->s->state = JK_LB_STATE_NA;
+                w->s->state = JK_LB_STATE_IDLE;
         }
         w->s->elected_snapshot = w->s->elected;
     }
@@ -1258,7 +1258,7 @@
                     strncpy(p->lb_workers[i].s->redirect, s, JK_SHM_STR_SIZ);
 
                 p->lb_workers[i].s->lb_value = 0;
-                p->lb_workers[i].s->state = JK_LB_STATE_NA;
+                p->lb_workers[i].s->state = JK_LB_STATE_IDLE;
                 p->lb_workers[i].s->error_time = 0;
                 p->lb_workers[i].s->activation =
                     jk_get_worker_activation(props, worker_names[i]);

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h?view=diff&rev=550241&r1=550240&r2=550241
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h Sun Jun 24 07:56:17 
2007
@@ -57,23 +57,23 @@
 #define JK_LB_LOCK_TEXT_OPTIMISTIC     ("Optimistic")
 #define JK_LB_LOCK_TEXT_PESSIMISTIC    ("Pessimistic")
 #define JK_LB_LOCK_TEXT_DEF            (JK_LB_LOCK_TEXT_OPTIMISTIC)
-#define JK_LB_STATE_NA                 (0)
+#define JK_LB_STATE_IDLE               (0)
 #define JK_LB_STATE_OK                 (1)
 #define JK_LB_STATE_RECOVER            (2)
 #define JK_LB_STATE_BUSY               (3)
 #define JK_LB_STATE_ERROR              (4)
 #define JK_LB_STATE_FORCE              (5)
 #define JK_LB_STATE_PROBE              (6)
-#define JK_LB_STATE_DEF                (JK_LB_STATE_NA)
-#define JK_LB_STATE_TEXT_NA            ("N/A")
+#define JK_LB_STATE_DEF                (JK_LB_STATE_IDLE)
+#define JK_LB_STATE_TEXT_IDLE          ("OK/IDLE")
 #define JK_LB_STATE_TEXT_OK            ("OK")
-#define JK_LB_STATE_TEXT_RECOVER       ("REC")
-#define JK_LB_STATE_TEXT_BUSY          ("BSY")
+#define JK_LB_STATE_TEXT_RECOVER       ("ERR/REC")
+#define JK_LB_STATE_TEXT_BUSY          ("OK/BUSY")
 #define JK_LB_STATE_TEXT_ERROR         ("ERR")
-#define JK_LB_STATE_TEXT_FORCE         ("FRC")
-#define JK_LB_STATE_TEXT_PROBE         ("PRB")
+#define JK_LB_STATE_TEXT_FORCE         ("ERR/FRC")
+#define JK_LB_STATE_TEXT_PROBE         ("ERR/PRB")
 #define JK_LB_STATE_TEXT_MAX           (JK_LB_STATE_PROBE)
-#define JK_LB_STATE_TEXT_DEF           (JK_LB_STATE_TEXT_NA)
+#define JK_LB_STATE_TEXT_DEF           (JK_LB_STATE_TEXT_IDLE)
 #define JK_LB_ACTIVATION_ACTIVE        (0)
 #define JK_LB_ACTIVATION_DISABLED      (1)
 #define JK_LB_ACTIVATION_STOPPED       (2)

Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_status.c?view=diff&rev=550241&r1=550240&r2=550241
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Sun Jun 24 07:56:17 
2007
@@ -137,7 +137,7 @@
 #define JK_STATUS_MASK_DISABLED            0x0000FF00
 #define JK_STATUS_MASK_STOPPED             0x00FF0000
 #define JK_STATUS_MASK_OK                  0x00010101
-#define JK_STATUS_MASK_NA                  0x00020202
+#define JK_STATUS_MASK_IDLE                0x00020202
 #define JK_STATUS_MASK_BUSY                0x00040404
 #define JK_STATUS_MASK_RECOVER             0x00080808
 #define JK_STATUS_MASK_ERROR               0x00101010
@@ -201,7 +201,7 @@
 #define JK_STATUS_SHOW_MEMBER_HEAD         "<tr>" \
                                            
"<th>&nbsp;</th><th>Name</th><th>Type</th>" \
                                            "<th>Host</th><th>Addr</th>" \
-                                           "<th>Act</th><th>Stat</th>" \
+                                           "<th>Act</th><th>State</th>" \
                                            "<th>D</th><th>F</th><th>M</th>" \
                                            "<th>V</th><th>Acc</th>" \
                                            "<th>Err</th><th>CE</th>" \
@@ -562,8 +562,8 @@
     case JK_LB_STATE_OK:
         mask &= JK_STATUS_MASK_OK;
         break;
-    case JK_LB_STATE_NA:
-        mask &= JK_STATUS_MASK_NA;
+    case JK_LB_STATE_IDLE:
+        mask &= JK_STATUS_MASK_IDLE;
         break;
     case JK_LB_STATE_BUSY:
         mask &= JK_STATUS_MASK_BUSY;
@@ -620,9 +620,11 @@
     case 'O':
     case 'o':
         return JK_STATUS_MASK_OK;
+    case 'I':
+    case 'i':
     case 'N':
     case 'n':
-        return JK_STATUS_MASK_NA;
+        return JK_STATUS_MASK_IDLE;
     case 'B':
     case 'b':
         return JK_STATUS_MASK_BUSY;
@@ -2467,8 +2469,9 @@
             "<tr><th>Addr</th><td>Backend Address info</td></tr>\n"
             "<tr><th>Act</th><td>Worker activation configuration<br/>\n"
             "ACT=Active, DIS=Disabled, STP=Stopped</td></tr>\n"
-            "<tr><th>Stat</th><td>Worker error status<br/>\n"
-            "OK=OK, N/A=Unknown, ERR=Error, BSY=Busy<br/>\n"
+            "<tr><th>State</th><td>Worker error status<br/>\n"
+            "OK=OK, ERR=Error with substates<br/>\n"
+            "IDLE=No requests handled, BUSY=All connections busy,<br/>\n"
             "REC=Recovering, PRB=Probing, FRC=Forced Recovery</td></tr>\n"
             "<tr><th>D</th><td>Worker distance</td></tr>\n"
             "<tr><th>F</th><td>Load Balancer factor</td></tr>\n"
@@ -2850,7 +2853,7 @@
             wr->s->recovery_errors  = 0;
             wr->s->readed           = 0;
             wr->s->transferred      = 0;
-            wr->s->state            = JK_LB_STATE_NA;
+            wr->s->state            = JK_LB_STATE_IDLE;
         }
         JK_TRACE_EXIT(l);
         return JK_TRUE;
@@ -2871,7 +2874,7 @@
         wr->s->recovery_errors  = 0;
         wr->s->readed           = 0;
         wr->s->transferred      = 0;
-        wr->s->state            = JK_LB_STATE_NA;
+        wr->s->state            = JK_LB_STATE_IDLE;
         JK_TRACE_EXIT(l);
         return JK_TRUE;
     }

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?view=diff&rev=550241&r1=550240&r2=550241
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Sun Jun 24 
07:56:17 2007
@@ -28,6 +28,13 @@
   <subsection name="Native">
     <changelog>
       <update>
+      Status worker: Renamed runtime states. All states have a major
+      state (OK or ERR) and a substate. Changed the name N/A to OK/IDLE.
+      Added docs about the meaning of the states to the status worker
+      page in the reference guide.
+      No new states have been added to code. (rjung)
+      </update>
+      <update>
       Common: Add recovery options for recovering idempotent http methods
       HEAD and GET. (rjung)
       </update>

Modified: tomcat/connectors/trunk/jk/xdocs/reference/status.xml
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/reference/status.xml?view=diff&rev=550241&r1=550240&r2=550241
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/reference/status.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/reference/status.xml Sun Jun 24 07:56:17 
2007
@@ -287,13 +287,40 @@
 <p>
 The categorization is based on the activation state of the workers (active, 
disabled or stopped),
 which is a pure configuration state, and the runtime state
-(OK, N/A, busy, recovering, probing, forced recovery, error)
+(OK or ERR with possible substates idle, busy, recovering, probing, and forced 
recovery)
 which only depends on the runtime situation.
 </p>
 <p>
+The runtime substates have the following meaning:
+<ul>
+<li>
+<b>OK (idle)</b>: This worker didn't receive any request since the last 
balancer
+maintenance. By default balancer maintenance runs every 60 seconds. The
+worker should be OK, but since we didn't have to use it for some time, we
+can't be sure. This state has been called N/A before version 1.2.24.
+</li>
+<li>
+<b>OK (busy)</b>: All connections for this worker are in use for requests.
+</li>
+<li>
+<b>ERROR (recovering)</b>: The worker was in error state for some time and is 
now
+marked for recovery. The next request suitable for thi worker will use it.
+</li>
+<li>
+<b>ERROR (probing)</b>: After setting the worker to recovering, we received a 
request
+suitable for this worker. This request is now using the worker.
+</li>
+<li>
+<b>ERROR (forced recovery)</b>: The worker is in error, but we don't have an 
alternative
+worker, so we keep using it.
+</li>
+</ul>
+</p>
+<p>
 By default the status worker groups into "good" all members, that have 
activation "active" and
-runtime state not equal to "error". The "bad" group consists of the members, 
that have either activation
-"stopped", or are in runtime state "error".
+runtime state not equal to "error" with empty substate.
+The "bad" group consists of the members, that have either activation
+"stopped", or are in runtime state "error" with empty substate.
 </p>
 <p>
 Workers that fit neither of the two groups, are considered to be "degraded".
@@ -302,11 +329,11 @@
 You can define other rules for the grouping into good, bad and degraded.
 The two attributes "good" and "bad" can be populated by a comma-separated list 
ob single characters or
 dot-separated pairs. Each character stands for the first character of one of 
the possible states "active",
-"disabled", "stopped", "ok", "na", "busy", "recovering" and "error". The 
additional states "probing"
+"disabled", "stopped", "ok", "idle", "busy", "recovering" and "error". The 
additional states "probing"
 and "forced recovery" are always rated equivalent to "recovering".
 Comma-separated entries will be combined
 with logical "or", if you combine a configuration and a runtime state with a 
dot. the are combined with logical
-"and". So the default value for "good" is "a.o,a.n,a.b,a.r", for "bad" it is 
"e,s".
+"and". So the default value for "good" is "a.o,a.i,a.b,a.r", for "bad" it is 
"e,s".
 </p>
 <p>
 The status worker first tries to match against the "bad" definitions, if this 
doesn't succeed



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to