THRIFT-3197: keepAliveTime is hard coded as 60 sec in TThreadPoolServer
Client: java
Patch: Pankaj Kumar
Creating ThreadPoolExecutor in TThreadPoolServer, keepAliveTime is hard coded as 60 sec.
diff --git a/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java b/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
index 65257ec..a963bc9 100755
--- a/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
+++ b/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
@@ -70,6 +70,11 @@
return this;
}
+ public Args stopTimeoutVal(int n) {
+ stopTimeoutVal = n;
+ return this;
+ }
+
public Args requestTimeout(int n) {
requestTimeout = n;
return this;
@@ -130,7 +135,7 @@
new SynchronousQueue<Runnable>();
return new ThreadPoolExecutor(args.minWorkerThreads,
args.maxWorkerThreads,
- 60,
+ args.stopTimeoutVal,
TimeUnit.SECONDS,
executorQueue);
}