I've set hystrix threadpool configuration as - coreSize=10
, maximumSize=100
and allowMaximumSizeToDivergeFromCoreSize=true
for the command key. I deployed the application but it's rejecting the threads when QPS is high -
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@7bb2e868 rejected from java.util.concurrent.ThreadPoolExecutor@39627710[Running, pool size = 10, active threads = 10, queued tasks = 0, completed tasks = 3409]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at com.netflix.hystrix.strategy.concurrency.HystrixContextScheduler$ThreadPoolWorker.schedule(HystrixContextScheduler.java:172)
at com.netflix.hystrix.strategy.concurrency.HystrixContextScheduler$HystrixContextSchedulerWorker.schedule(HystrixContextScheduler.java:106)
I'm using hystrix-javanica 1.5.12
version. This is not working as queued tasks are 0.
The rest of the default values are as follows (names below are abstracted a bit) -
isCircuitBreakerEnabled = true;
circuitBreakerRequestVolumeThreshold = 10;
isFallBackEnabled = false;
circuitBreakerSleepWindow = 10000;
circuitBreakerErrorThresholdPercentage = 50;
circuitBreakerForceOpen = false;
circuitBreakerForceClosed = false;
metricsRollingStats = 10000;
executionIsolationThreadTimeOut = 20000;
executionIsolationStrategy = "THREAD";
executionTimeOutEnable = true;
poolCoreSize = 10;
poolMaxSize = 15;
poolMaxQueueSize = -1;
keepAliveTime = 1;
poolQueueSizeRejectionThreshold = 1;
allowMaximumSizeToDivergeFromCoreSize = false;
I was following the issue - https://github.com/Netflix/Hystrix/issues/1436. One more person reported the similar issue with this version in 2017.
Do you think I'm missing any configuration? Should I change executionIsolationStrategy to Semaphore
to make it work?