Replace container thread pool API

pull/257/head
chen.ma 3 years ago
parent bf1acefaee
commit 6df84d536f

@ -88,8 +88,8 @@ public class JettyWebThreadPoolHandler extends AbstractWebThreadPoolService {
QueuedThreadPool jettyExecutor = (QueuedThreadPool) executor;
int minThreads = jettyExecutor.getMinThreads();
int maxThreads = jettyExecutor.getMaxThreads();
Integer coreSize = threadPoolParameterInfo.getCorePoolSize();
Integer maxSize = threadPoolParameterInfo.getMaximumPoolSize();
Integer coreSize = threadPoolParameterInfo.corePoolSizeAdapt();
Integer maxSize = threadPoolParameterInfo.maximumPoolSizeAdapt();
jettyExecutor.setMinThreads(coreSize);
jettyExecutor.setMaxThreads(maxSize);
log.info("[JETTY] Changed web thread pool. corePoolSize :: [{}], maximumPoolSize :: [{}]",

@ -119,12 +119,12 @@ public class TomcatWebThreadPoolHandler extends AbstractWebThreadPoolService {
int originalCoreSize = tomcatExecutor.getCorePoolSize();
int originalMaximumPoolSize = tomcatExecutor.getMaximumPoolSize();
long originalKeepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS);
tomcatExecutor.setCorePoolSize(threadPoolParameterInfo.getCorePoolSize());
tomcatExecutor.setMaximumPoolSize(threadPoolParameterInfo.getMaximumPoolSize());
tomcatExecutor.setCorePoolSize(threadPoolParameterInfo.corePoolSizeAdapt());
tomcatExecutor.setMaximumPoolSize(threadPoolParameterInfo.maximumPoolSizeAdapt());
tomcatExecutor.setKeepAliveTime(threadPoolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS);
log.info("[TOMCAT] Changed web thread pool. corePoolSize :: [{}], maximumPoolSize :: [{}], keepAliveTime :: [{}]",
String.format(CHANGE_DELIMITER, originalCoreSize, threadPoolParameterInfo.getCorePoolSize()),
String.format(CHANGE_DELIMITER, originalMaximumPoolSize, threadPoolParameterInfo.getMaximumPoolSize()),
String.format(CHANGE_DELIMITER, originalCoreSize, threadPoolParameterInfo.corePoolSizeAdapt()),
String.format(CHANGE_DELIMITER, originalMaximumPoolSize, threadPoolParameterInfo.maximumPoolSizeAdapt()),
String.format(CHANGE_DELIMITER, originalKeepAliveTime, threadPoolParameterInfo.getKeepAliveTime()));
} catch (Exception ex) {
log.error("Failed to modify the Tomcat thread pool parameter.", ex);

@ -152,8 +152,8 @@ public class UndertowWebThreadPoolHandler extends AbstractWebThreadPoolService {
public void updateWebThreadPool(ThreadPoolParameterInfo threadPoolParameterInfo) {
try {
XnioWorker xnioWorker = (XnioWorker) executor;
Integer coreSize = threadPoolParameterInfo.getCorePoolSize();
Integer maxSize = threadPoolParameterInfo.getMaximumPoolSize();
Integer coreSize = threadPoolParameterInfo.corePoolSizeAdapt();
Integer maxSize = threadPoolParameterInfo.maximumPoolSizeAdapt();
Integer keepAliveTime = threadPoolParameterInfo.getKeepAliveTime();
int originalCoreSize = xnioWorker.getOption(Options.WORKER_TASK_CORE_THREADS);
int originalMaximumPoolSize = xnioWorker.getOption(Options.WORKER_TASK_MAX_THREADS);

Loading…
Cancel
Save