Author: jfrederic.clere(a)jboss.com
Date: 2010-12-06 06:54:20 -0500 (Mon, 06 Dec 2010)
New Revision: 1602
Modified:
branches/2.1.x/java/org/apache/coyote/Constants.java
branches/2.1.x/java/org/apache/coyote/ajp/AjpAprProtocol.java
branches/2.1.x/java/org/apache/coyote/ajp/AjpProtocol.java
branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java
Log:
Fix for JBWEB-186.
Modified: branches/2.1.x/java/org/apache/coyote/Constants.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/Constants.java 2010-12-01 13:49:46 UTC (rev
1601)
+++ branches/2.1.x/java/org/apache/coyote/Constants.java 2010-12-06 11:54:20 UTC (rev
1602)
@@ -68,4 +68,7 @@
"org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER",
"false")).booleanValue();
+ public static final int MAX_PAUSE_WAIT =
+ Integer.valueOf(System.getProperty("org.apache.coyote.MAX_PAUSE_WAIT",
"60")).intValue();
+
}
Modified: branches/2.1.x/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-12-01 13:49:46 UTC
(rev 1601)
+++ branches/2.1.x/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-12-06 11:54:20 UTC
(rev 1602)
@@ -205,8 +205,9 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -214,10 +215,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("ajpprotocol.pause", getName()));
Modified: branches/2.1.x/java/org/apache/coyote/ajp/AjpProtocol.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/ajp/AjpProtocol.java 2010-12-01 13:49:46 UTC
(rev 1601)
+++ branches/2.1.x/java/org/apache/coyote/ajp/AjpProtocol.java 2010-12-06 11:54:20 UTC
(rev 1602)
@@ -204,8 +204,9 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -213,10 +214,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("ajpprotocol.pause", getName()));
Modified: branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-12-01
13:49:46 UTC (rev 1601)
+++ branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-12-06
11:54:20 UTC (rev 1602)
@@ -153,8 +153,9 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -162,10 +163,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if(log.isInfoEnabled())
log.info(sm.getString("http11protocol.pause", getName()));
Modified: branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java 2010-12-01 13:49:46
UTC (rev 1601)
+++ branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java 2010-12-06 11:54:20
UTC (rev 1602)
@@ -219,8 +219,9 @@
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
- while (!done && retry < 20) {
+ while (!done && retry < org.apache.coyote.Constants.MAX_PAUSE_WAIT) {
retry++;
+ done = true;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
@@ -228,10 +229,10 @@
} catch (InterruptedException e) {
;
}
- continue;
+ done = false;
+ break;
}
}
- done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("http11protocol.pause", getName()));