catched ConcurrentModificationException in ConnectionInfo.cleanUp so cleanUp is not interrupted

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4692 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
danielr 17 years ago
parent 70826bb501
commit 64c33e717f

@ -30,6 +30,8 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import de.anomic.server.logging.serverLog;
/**
* Information about a connection
*
@ -152,12 +154,16 @@ public class HttpConnectionInfo {
* removes stale connections
*/
public static void cleanUp() {
synchronized (allConnections) {
for(HttpConnectionInfo con: allConnections) {
if(con.getLifetime() > staleAfterMillis) {
allConnections.remove(con);
try {
synchronized (allConnections) {
for(HttpConnectionInfo con: allConnections) {
if(con.getLifetime() > staleAfterMillis) {
allConnections.remove(con);
}
}
}
} catch (java.util.ConcurrentModificationException e) {
serverLog.logWarning("HTTPC", "cleanUp ConnectionInfo interrupted by ConcurrentModificationException");
}
}

Loading…
Cancel
Save