Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) fixed exceptions that occured when non-integer values were entered where integers were expected

low012b54fcd732b06
diff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.java
index b8b4f4faf..fea7dd84f 100644
--- a/htroot/ConfigNetwork_p.java
+++ b/htroot/ConfigNetwork_p.java
@@ -117,7 +117,10 @@ public class ConfigNetwork_p {
// read remote crawl request settings
sb.setConfig("crawlResponse", (crawlResponse) ? "true" : "false");
- int newppm = Math.max(1, Integer.parseInt(post.get("acceptCrawlLimit", "1")));
+ int newppm = 1;
+ try {
+ newppm = Math.max(1, Integer.parseInt(post.get("acceptCrawlLimit", "1")));
+ } catch (NumberFormatException e) {}
long newBusySleep = Math.max(100, 60000 / newppm);
serverThread rct = sb.getThread(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
rct.setBusySleep(newBusySleep);
@@ -136,7 +139,10 @@ public class ConfigNetwork_p {
// write remote crawl request settings
prop.put("crawlResponse", sb.getConfigBool("crawlResponse", false) ? 1 : 0);
- long RTCbusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100"));
+ long RTCbusySleep = 100;
+ try {
+ RTCbusySleep = Integer.parseInt(env.getConfig(plasmaSwitchboard.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, "100"));
+ } catch (NumberFormatException e) {}
int RTCppm = (int) (60000L / RTCbusySleep);
prop.put("acceptCrawlLimit", RTCppm);
diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java
index 60a883bbe..0f81f7875 100644
--- a/htroot/PerformanceQueues_p.java
+++ b/htroot/PerformanceQueues_p.java
@@ -223,10 +223,22 @@ public class PerformanceQueues_p {
*/
serverThread httpd = switchboard.getThread("10_httpd");
GenericObjectPool.Config httpdPoolConfig = ((serverCore)httpd).getPoolConfig();
- maxActive = Integer.parseInt(post.get("httpd Session Pool_maxActive","8"));
- maxIdle = Integer.parseInt(post.get("httpd Session Pool_maxIdle","4"));
- minIdle = Integer.parseInt(post.get("httpd Session Pool_minIdle","0"));
-
+ try {
+ maxActive = Integer.parseInt(post.get("httpd Session Pool_maxActive","8"));
+ } catch (NumberFormatException e) {
+ maxActive = 8;
+ }
+ try {
+ maxIdle = Integer.parseInt(post.get("httpd Session Pool_maxIdle","4"));
+ } catch (NumberFormatException e) {
+ maxIdle = 4;
+ }
+ try {
+ minIdle = Integer.parseInt(post.get("httpd Session Pool_minIdle","0"));
+ } catch (NumberFormatException e) {
+ minIdle = 0;
+ }
+
httpdPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle;
httpdPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle;
httpdPoolConfig.maxActive = maxActive;
@@ -237,15 +249,27 @@ public class PerformanceQueues_p {
switchboard.setConfig("httpdMaxActiveSessions",maxActive);
switchboard.setConfig("httpdMaxIdleSessions",maxIdle);
switchboard.setConfig("httpdMinIdleSessions",minIdle);
-
+
/*
* Configuring the crawlStacker pool
*/
GenericObjectPool.Config stackerPoolConfig = switchboard.sbStackCrawlThread.getPoolConfig();
- maxActive = Integer.parseInt(post.get("CrawlStacker Session Pool_maxActive","10"));
- maxIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_maxIdle","10"));
- minIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_minIdle","5"));
-
+ try {
+ maxActive = Integer.parseInt(post.get("CrawlStacker Session Pool_maxActive","10"));
+ } catch (NumberFormatException e) {
+ maxActive = 10;
+ }
+ try {
+ maxIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_maxIdle","10"));
+ } catch (NumberFormatException e) {
+ maxIdle = 10;
+ }
+ try {
+ minIdle = Integer.parseInt(post.get("CrawlStacker Session Pool_minIdle","5"));
+ } catch (NumberFormatException e) {
+ minIdle = 5;
+ }
+
stackerPoolConfig.minIdle = (minIdle > maxIdle) ? maxIdle/2 : minIdle;
stackerPoolConfig.maxIdle = (maxIdle > maxActive) ? maxActive/2 : maxIdle;
stackerPoolConfig.maxActive = maxActive;