You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by lu...@apache.org on 2004/01/27 18:59:27 UTC
cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote RequestGroupInfo.java
luehe 2004/01/27 09:59:27
Modified: coyote/src/java/org/apache/coyote RequestGroupInfo.java
Log:
Avoid java.util.ConcurrentModificationException seen with very high load.
It seems synchronization has become necessary since the addition of the
removeRequestProcessor() method.
Revision Changes Path
1.3 +14 -14 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/RequestGroupInfo.java
Index: RequestGroupInfo.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/RequestGroupInfo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RequestGroupInfo.java 15 Jan 2004 13:16:49 -0000 1.2
+++ RequestGroupInfo.java 27 Jan 2004 17:59:27 -0000 1.3
@@ -9,15 +9,15 @@
public class RequestGroupInfo {
ArrayList processors=new ArrayList();
- public void addRequestProcessor( RequestInfo rp ) {
+ public synchronized void addRequestProcessor( RequestInfo rp ) {
processors.add( rp );
}
- public void removeRequestProcessor( RequestInfo rp ) {
+ public synchronized void removeRequestProcessor( RequestInfo rp ) {
processors.remove( rp );
}
- public long getMaxTime() {
+ public synchronized long getMaxTime() {
long maxTime=0;
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
@@ -27,14 +27,14 @@
}
// Used to reset the times
- public void setMaxTime(long maxTime) {
+ public synchronized void setMaxTime(long maxTime) {
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
rp.setMaxTime(maxTime);
}
}
- public long getProcessingTime() {
+ public synchronized long getProcessingTime() {
long time=0;
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
@@ -43,14 +43,14 @@
return time;
}
- public void setProcessingTime(long totalTime) {
+ public synchronized void setProcessingTime(long totalTime) {
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
rp.setProcessingTime( totalTime );
}
}
- public int getRequestCount() {
+ public synchronized int getRequestCount() {
int requestCount=0;
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
@@ -59,14 +59,14 @@
return requestCount;
}
- public void setRequestCount(int requestCount) {
+ public synchronized void setRequestCount(int requestCount) {
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
rp.setRequestCount( requestCount );
}
}
- public int getErrorCount() {
+ public synchronized int getErrorCount() {
int requestCount=0;
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
@@ -75,14 +75,14 @@
return requestCount;
}
- public void setErrorCount(int errorCount) {
+ public synchronized void setErrorCount(int errorCount) {
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
rp.setErrorCount( errorCount);
}
}
- public long getBytesReceived() {
+ public synchronized long getBytesReceived() {
long bytes=0;
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
@@ -91,14 +91,14 @@
return bytes;
}
- public void setBytesReceived(long bytesReceived) {
+ public synchronized void setBytesReceived(long bytesReceived) {
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
rp.setBytesReceived( bytesReceived );
}
}
- public long getBytesSent() {
+ public synchronized long getBytesSent() {
long bytes=0;
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
@@ -107,7 +107,7 @@
return bytes;
}
- public void setBytesSent(long bytesSent) {
+ public synchronized void setBytesSent(long bytesSent) {
for( int i=0; i<processors.size(); i++ ) {
RequestInfo rp=(RequestInfo)processors.get( i );
rp.setBytesSent( bytesSent );
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote
RequestGroupInfo.java
Posted by Remy Maucherat <re...@apache.org>.
Remy Maucherat wrote:
> luehe@apache.org wrote:
>
>> luehe 2004/01/27 09:59:27
>>
>> Modified: coyote/src/java/org/apache/coyote RequestGroupInfo.java
>> Log:
>> Avoid java.util.ConcurrentModificationException seen with very high
>> load.
>> It seems synchronization has become necessary since the addition of the
>> removeRequestProcessor() method.
>
>
> -1 for syncing the statistics updates. +1 for the add/remove.
Hmmm, forget it, it's late and I'm tired ;) This has nothing to do with
the statistics update, and seems to be reserved to statistics resetting.
So it seems to be all good.
Glad to see my email is working again :)
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote
RequestGroupInfo.java
Posted by Remy Maucherat <re...@apache.org>.
luehe@apache.org wrote:
> luehe 2004/01/27 09:59:27
>
> Modified: coyote/src/java/org/apache/coyote RequestGroupInfo.java
> Log:
> Avoid java.util.ConcurrentModificationException seen with very high load.
> It seems synchronization has become necessary since the addition of the
> removeRequestProcessor() method.
-1 for syncing the statistics updates. +1 for the add/remove.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org