New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed ThreadPoolExecutor setCorePoolSize implementation on Java 10+ #1874
Comments
Looks like it's Java 9+. From the Java 8 API docs for ThreadPoolExecutor#setCorePoolSize:
From the Java 9 API docs for ThreadPoolExecutor#setCorePoolSize:
Here's a minimal example - it can be triggered if the core size is changed through Archaius: @Test
void simplestTest() throws Exception {
var command = new HystrixCommand<>(HystrixCommand.Setter
.withGroupKey(HystrixCommandGroupKey.Factory.asKey("Group"))
.andCommandKey(HystrixCommandKey.Factory.asKey("Command"))) {
@Override
protected String run() throws Exception {
return null;
}
};
// ConfigurationManager is from Archaius
ConfigurationManager.getConfigInstance().setProperty("hystrix.threadpool.Group.coreSize", 11);
command.execute();
} This exception is thrown when the command is executed:
|
The Hystrix documentation here: https://github.com/Netflix/Hystrix/wiki/Configuration#maximumSize |
The issue appears also when you set the coresize greater then the default maximum size, because of a failed implementation of the HystrixThreadPool class. The error appears, because firstly the core size is set and after this the maximus size of the threadpool. At the moment when the core size is set and it is bigger then the default size (10) the IllegalArgumentException is thrown. In this case you could set allowMaximumSizeToDivergeFromCoreSize as you like. It doesnt fix the error! |
I meet this issue also,but how can I replay this issue,no one would write 'ConfigurationManager.getConfigInstance().setProperty("hystrix.threadpool.Group.coreSize", 11);' such code in application,anywhere interface to modify the properties? |
On OpenJdk 11 the implementation of ThreadPoolExecutor's setCorePoolSize was changed and contains an additional constraints comparing the maxPoolSize and corePoolSize values.
If maxPoolSize is not changed but corePoolSize is given as a higher number of default maxPoolSize it throws IllegalArgumentException.
This causes issue here:
https://github.com/Netflix/Hystrix/blob/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPool.java#L230-L231
The text was updated successfully, but these errors were encountered: