Issue with NettyRuntime$AvailableProcessorsHolder: number of available processors
See original GitHub issueActual behavior
Exception is thrown when both Redis/lettuce & Elasticsearch clients try to set number of available processors on netty.
Stacktrace
Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]
at io.netty.util.NettyRuntime$AvailableProcessorsHolder.setAvailableProcessors(NettyRuntime.java:51) ~[netty-common-4.1.12.Final.jar:4.1.12.Final]
at io.netty.util.NettyRuntime.setAvailableProcessors(NettyRuntime.java:87) ~[netty-common-4.1.12.Final.jar:4.1.12.Final]
at org.elasticsearch.transport.netty4.Netty4Utils.setAvailableProcessors(Netty4Utils.java:82) ~[transport-netty4-client-5.5.0.jar:5.5.0]
at org.elasticsearch.transport.netty4.Netty4Transport.<init>(Netty4Transport.java:138) ~[transport-netty4-client-5.5.0.jar:5.5.0]
at org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4Transport.<init>(SecurityNetty4Transport.java:71) ~[x-pack-api-5.5.0.jar:5.5.0]
at org.elasticsearch.xpack.security.Security.lambda$getTransports$13(Security.java:842) ~[x-pack-api-5.5.0.jar:5.5.0]
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:174) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:265) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:130) ~[transport-5.5.0.jar:5.5.0]
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:55) ~[x-pack-transport-5.5.0.jar:5.5.0]
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:50) ~[x-pack-transport-5.5.0.jar:5.5.0]
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:46) ~[x-pack-transport-5.5.0.jar:5.5.0]
at com.bignibou.configuration.search.cloud.connector.ElasticsearchTransportClientCreator.create(ElasticsearchTransportClientCreator.java:38) ~[bignibou-common.jar:?]
at com.bignibou.configuration.search.cloud.connector.ElasticsearchTransportClientCreator.create(ElasticsearchTransportClientCreator.java:23) ~[bignibou-common.jar:?]
at org.springframework.cloud.Cloud.getServiceConnector(Cloud.java:245) ~[spring-cloud-core-2.0.0.M1.jar:?]
at org.springframework.cloud.Cloud.getSingletonServiceConnector(Cloud.java:155) ~[spring-cloud-core-2.0.0.M1.jar:?]
at org.springframework.cloud.config.java.CloudServiceConnectionFactory.service(CloudServiceConnectionFactory.java:327) ~[spring-cloud-spring-service-connector-2.0.0.M1.jar:?]
at com.bignibou.configuration.search.ElasticsearchConfiguration.client(ElasticsearchConfiguration.java:18) ~[bignibou-common.jar:?]
at com.bignibou.configuration.search.ElasticsearchConfiguration$$EnhancerBySpringCGLIB$$7ea6662d.CGLIB$client$0(<generated>) ~[bignibou-common.jar:?]
at com.bignibou.configuration.search.ElasticsearchConfiguration$$EnhancerBySpringCGLIB$$7ea6662d$$FastClassBySpringCGLIB$$e0f8345b.invoke(<generated>) ~[bignibou-common.jar:?]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.0.RC2.jar:5.0.0.RC2]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:359) ~[spring-context-5.0.0.RC2.
Netty version
4.1.12.Final
JVM version (e.g. java -version
)
java version “1.8.0_102” Java™ SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot™ 64-Bit Server VM (build 25.102-b14, mixed mode)
OS version (e.g. uname -a
)
Darwin Kernel Version 16.4.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Environment.ProcessorCount Property (System)
Gets the number of processors available to the current process. ... NET runtime startup for the process lifetime. It does not reflect changes...
Read more >Issues related to Environment.ProcessorCount calculation
Below is how we calculate the processor count ( Environment. ... NET runtime behavior is consistent between OS versions (ie finally fix #13465)....
Read more >Ask Question - Stack Overflow
The number of logical processors is available through the Environment class ... Management.dll In .NET Core, this is available (for Windows only) as...
Read more >How To Stop The .NET Runtime Optimization Service From ...
If you have your CPU mostly busy with the .Net runtime optimization service, read on to find out how to fix it.
Read more >[JDK-8157478] add option to change value returned by java ...
Runtime.availableProcessors() and its Hotspot internal equivalent. Various things in the system, such as the number of threads in the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am getting this exception with Elasticsearch java Transport client v. 6.2.4 if I don’t set the system property:
es.set.netty.runtime.available.processors=false
.@jasontedor any idea ?