do not block server session if maximum number of sessions is reached, just try to clean up once

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7095 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 3988a95fb5
commit 1da5241c2d

@ -319,15 +319,15 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
announceThreadBlockRelease();
int pp, trycount = 0;
while ((pp = getJobCount()) >= this.maxBusySessions) {
int pp/*, trycount = 0*/;
if ((pp = getJobCount()) >= this.maxBusySessions) {
terminateOldSessions(3000);
this.log.logInfo("termination of old sessions: before = " + pp + ", after = " + getJobCount());
if (getJobCount() < this.maxBusySessions) break;
if (trycount++ > 5) break;
Thread.sleep(1000); // lets try again after a short break
//if (getJobCount() < this.maxBusySessions) break;
//if (trycount++ > 5) break;
//Thread.sleep(1000); // lets try again after a short break
}
/*
if (getJobCount() >= this.maxBusySessions) {
// immediately close connection if too much sessions are still running
this.log.logWarning("* connections (" + getJobCount() + ") exceeding limit (" + this.maxBusySessions + ")" + ", closing new incoming connection from "+ controlSocket.getRemoteSocketAddress());
@ -336,6 +336,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
return false;
}
*/
final String cIP = clientAddress(controlSocket);
//System.out.println("server bfHosts=" + bfHost.toString());

Loading…
Cancel
Save