Skip to content
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

Add checks for quarkus.elasticsearch.max-connections and quarkus.elasticsearch.max-connections-per-route values #35684

Open
rsvoboda opened this issue Sep 1, 2023 · 2 comments
Assignees
Labels

Comments

@rsvoboda
Copy link
Member

rsvoboda commented Sep 1, 2023

Description

Add checks for quarkus.elasticsearch.max-connections and quarkus.elasticsearch.max-connections-per-route values.
quarkus.elasticsearch.io-thread-counts could be checked on Quarkus side too, some details a bit lower.

0 or negative is forbidden in Hibernate Search, it probably should be in this client as well

https://github.com/quarkusio/quarkus/blob/main/extensions/elasticsearch-rest-client/runtime/src/main/java/io/quarkus/elasticsearch/restclient/lowlevel/runtime/RestClientBuilderHelper.java#L75 passes the values to HttpAsyncClientBuilder

And it reflects only the values higher than 0 in public CloseableHttpAsyncClient build() method

                if (maxConnTotal > 0) {
                    poolingmgr.setMaxTotal(maxConnTotal);
                }
                if (maxConnPerRoute > 0) {
                    poolingmgr.setDefaultMaxPerRoute(maxConnPerRoute);
                }

quarkus.elasticsearch.io-thread-counts=0 throws exception in runtime when the client is used/injected for the first time.
The check is done outside Quarkus, quarkus.elasticsearch.io-thread-counts could be checked on Quarkus side too.

Caused by: java.lang.IllegalArgumentException: ioThreadCount may not be negative or zero
	at org.apache.http.util.Args.positive(Args.java:104)
	at org.apache.http.impl.nio.reactor.IOReactorConfig.<init>(IOReactorConfig.java:95)
	at org.apache.http.impl.nio.reactor.IOReactorConfig$Builder.build(IOReactorConfig.java:505)
	at io.quarkus.elasticsearch.restclient.lowlevel.runtime.RestClientBuilderHelper$2.customizeHttpClient(RestClientBuilderHelper.java:71)

Implementation ideas

No response

@rsvoboda rsvoboda added the kind/enhancement New feature or request label Sep 1, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 1, 2023

/cc @gsmet (elasticsearch), @loicmathieu (elasticsearch)

@yrodiere
Copy link
Member

We might want to wait for smallrye/smallrye-config#1006 before we work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants