Skip to content

Commit a37ff8c

Browse files
committed
Handle coreSize > maximumSize in HystrixThreadPoolConfiguration
1 parent 9ab65f1 commit a37ff8c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

hystrix-core/src/main/java/com/netflix/hystrix/config/HystrixThreadPoolConfiguration.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,20 @@ public HystrixThreadPoolConfiguration(HystrixThreadPoolKey threadPoolKey, int co
3535
int keepAliveTimeInMinutes, boolean allowMaximumSizeToDivergeFromCoreSize, int rollingCounterNumberOfBuckets,
3636
int rollingCounterBucketSizeInMilliseconds) {
3737
this.threadPoolKey = threadPoolKey;
38+
this.allowMaximumSizeToDivergeFromCoreSize = allowMaximumSizeToDivergeFromCoreSize;
3839
this.coreSize = coreSize;
39-
this.maximumSize = maximumSize;
40+
if (allowMaximumSizeToDivergeFromCoreSize) {
41+
if (coreSize > maximumSize) {
42+
this.maximumSize = coreSize;
43+
} else {
44+
this.maximumSize = maximumSize;
45+
}
46+
} else {
47+
this.maximumSize = coreSize;
48+
}
4049
this.maxQueueSize = maxQueueSize;
4150
this.queueRejectionThreshold = queueRejectionThreshold;
4251
this.keepAliveTimeInMinutes = keepAliveTimeInMinutes;
43-
this.allowMaximumSizeToDivergeFromCoreSize = allowMaximumSizeToDivergeFromCoreSize;
4452
this.rollingCounterNumberOfBuckets = rollingCounterNumberOfBuckets;
4553
this.rollingCounterBucketSizeInMilliseconds = rollingCounterBucketSizeInMilliseconds;
4654
}

0 commit comments

Comments
 (0)