Skip to content

Commit

Permalink
Handle coreSize > maximumSize in HystrixThreadPoolConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrjacobs committed Dec 19, 2016
1 parent 9ab65f1 commit a37ff8c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ public HystrixThreadPoolConfiguration(HystrixThreadPoolKey threadPoolKey, int co
int keepAliveTimeInMinutes, boolean allowMaximumSizeToDivergeFromCoreSize, int rollingCounterNumberOfBuckets,
int rollingCounterBucketSizeInMilliseconds) {
this.threadPoolKey = threadPoolKey;
this.allowMaximumSizeToDivergeFromCoreSize = allowMaximumSizeToDivergeFromCoreSize;
this.coreSize = coreSize;
this.maximumSize = maximumSize;
if (allowMaximumSizeToDivergeFromCoreSize) {
if (coreSize > maximumSize) {
this.maximumSize = coreSize;
} else {
this.maximumSize = maximumSize;
}
} else {
this.maximumSize = coreSize;
}
this.maxQueueSize = maxQueueSize;
this.queueRejectionThreshold = queueRejectionThreshold;
this.keepAliveTimeInMinutes = keepAliveTimeInMinutes;
this.allowMaximumSizeToDivergeFromCoreSize = allowMaximumSizeToDivergeFromCoreSize;
this.rollingCounterNumberOfBuckets = rollingCounterNumberOfBuckets;
this.rollingCounterBucketSizeInMilliseconds = rollingCounterBucketSizeInMilliseconds;
}
Expand Down

0 comments on commit a37ff8c

Please sign in to comment.