Skip to content

Commit 4f03935

Browse files
committed
[FAB-17100] Default Thread Pool not set correctly
The advertised defaults where not set correctly. Signed-off-by: Matthew B. White <[email protected]>
1 parent 5ff847e commit 4f03935

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/impl/InnvocationTaskManager.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@ public InnvocationTaskManager(ChaincodeBase chaincode, ChaincodeID chaincodeId)
9090

9191
// setup the thread pool here
9292
Properties props = chaincode.getChaincodeConfig();
93-
queueSize = Integer.parseInt((String) props.getOrDefault("TP_QUEUE_SIZE", "1"));
94-
maximumPoolSize = Integer.parseInt((String) props.getOrDefault("TP_MAX_POOL_SIZE", "1"));
95-
corePoolSize = Integer.parseInt((String) props.getOrDefault("TP_CORE_POOL_SIZE", "1"));
93+
queueSize = Integer.parseInt((String) props.getOrDefault("TP_QUEUE_SIZE", "5000"));
94+
maximumPoolSize = Integer.parseInt((String) props.getOrDefault("TP_MAX_POOL_SIZE", "5"));
95+
corePoolSize = Integer.parseInt((String) props.getOrDefault("TP_CORE_POOL_SIZE", "5"));
9696
keepAliveTime = Long.parseLong((String) props.getOrDefault("TP_KEEP_ALIVE_MS", "5000"));
9797

98-
workQueue = new LinkedBlockingQueue<Runnable>(queueSize);
99-
100-
logger.info(() -> "Max Pool Size" + maximumPoolSize);
98+
logger.info(() -> "Max Pool Size [TP_MAX_POOL_SIZE]" + maximumPoolSize);
99+
logger.info(() -> "Queue Size [TP_CORE_POOL_SIZE]" + queueSize);
100+
logger.info(() -> "Core Pool Size [TP_QUEUE_SIZE]" + corePoolSize);
101+
logger.info(() -> "Keep Alive Time [TP_KEEP_ALIVE_MS]" + keepAliveTime);
101102

103+
workQueue = new LinkedBlockingQueue<Runnable>(queueSize);
102104
taskService = new InnvocationTaskExecutor(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
103105
threadFactory, handler);
104106

0 commit comments

Comments
 (0)