Author: mturk
Date: Sat Mar 7 08:00:54 2009
New Revision: 751217
URL: http://svn.apache.org/viewvc?rev=751217&view=rev
Log:
If the number of the channels in error more then half of the busy channels
mark the worker global status as error
Modified:
tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
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_ajp_common.c
URL:
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=751217&r1=751216&r2=751217&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Sat Mar 7
08:00:54 2009
@@ -2120,6 +2120,8 @@
aw->s->transferred += e->wr;
if (aw->s->busy)
aw->s->busy--;
+ if (aw->s->in_error)
+ aw->s->in_error--;
if (rc == JK_TRUE) {
aw->s->state = JK_AJP_STATE_OK;
}
@@ -2130,6 +2132,7 @@
else {
aw->s->state = JK_AJP_STATE_ERROR;
aw->s->errors++;
+ aw->s->in_error++;
aw->s->error_time = time(NULL);
}
}
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=751217&r1=751216&r2=751217&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sat Mar 7 08:00:54
2009
@@ -1340,7 +1340,7 @@
* Time for fault tolerance (if possible)...
*/
rec->s->errors++;
- if (rec->s->busy) {
+ if (rec->s->busy && (rec->s->busy / 2) > rec->in_errors) {
rec->s->state = JK_LB_STATE_OK;
}
else {
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?rev=751217&r1=751216&r2=751217&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_shm.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_shm.h Sat Mar 7 08:00:54 2009
@@ -98,6 +98,8 @@
volatile int busy;
/* Maximum number of busy channels */
volatile int max_busy;
+ /* Number of currently channels in error state */
+ volatile int in_error;
volatile time_t error_time;
/* Number of bytes read from remote */
volatile jk_uint64_t readed;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]