question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Elasticsearch `availableProcessors is already set` error when using Testcontainers netty transport

See original GitHub issue

So far I’ve only seen this affect our internal tests. On one of my machines I consistently get this failure:

Gradle Test Executor 5 > org.testcontainers.elasticsearch.ElasticsearchContainerTest > transportClientClusterHealth FAILED
    java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
        at io.netty.util.NettyRuntime$AvailableProcessorsHolder.setAvailableProcessors(NettyRuntime.java:51)
        at io.netty.util.NettyRuntime.setAvailableProcessors(NettyRuntime.java:87)
        at org.elasticsearch.transport.netty4.Netty4Utils.setAvailableProcessors(Netty4Utils.java:83)
        at org.elasticsearch.transport.netty4.Netty4Transport.<init>(Netty4Transport.java:112)
        at org.elasticsearch.transport.Netty4Plugin.lambda$getTransports$0(Netty4Plugin.java:86)
        at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:189)
        at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:283)
        at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
        at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:114)
        at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:104)
        at org.testcontainers.elasticsearch.ElasticsearchContainerTest.transportClientClusterHealth(ElasticsearchContainerTest.java:103)

I believe this is an instance of a known Elasticsearch client issue (https://github.com/elastic/elasticsearch/issues/25741). This will be arising because both Elasticsearch and docker-java can use netty.

It is heavily mitigated by okhttp being our default transport now, but this bug does mean that we can’t test the netty transport any more.

We should probably either:

@dadoonet you might have a better understanding of this - do you have any suggestions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rfelgentcommented, Apr 16, 2019

You have my respect that you have taken the effort to remove completely the dependency of Netty transport!

Thank you people!

0reactions
bsideupcommented, Mar 26, 2019

Since 1.11.0, we no longer include Netty transport and fully migrated to OkHttp. I’m closing this issue as not relevant anymore 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

availableProcessors is already set to [12], rejecting [12]
setProperty("es.set.netty.runtime.available.processors", "false"); to the function main.
Read more >
Elasticsearch `availableProcessors is already set` error when using ...
Elasticsearch `availableProcessors is already set` error when using Testcontainers netty transport.
Read more >
Elasticsearch 5.4.1 - availableProcessors is already set
Hi, I have upgraded elasticsearch from 5.4.0 to 5.4.1 and I have got this error: java.lang.IllegalStateException: availableProcessors is ...
Read more >
Elasticsearch container - Testcontainers for Java
This module helps running elasticsearch using Testcontainers. ... need to change cluster.name setting or set client.transport.ignore_cluster_name to true .
Read more >
Table of Contents - Micronaut Documentation
Micronaut Security 3.4.1 responds with an error when an authenticated user ... The Netty access logger now supports excluding requests based on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found