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

Document default connection-pool-size for rest-client #45148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

weltonrodrigo
Copy link
Contributor

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike its position in the tree could indicate, I think this config is used for both the classic and the reactive REST Clients. So we would need to make sure this change is correct for both of them.

@weltonrodrigo
Copy link
Contributor Author

Unlike its position in the tree could indicate, I think this config is used for both the classic and the reactive REST Clients. So we would need to make sure this change is correct for both of them.

I managed to find that the default for the resteasty-reactive was 20:

I managed to confirm that indeed the client is created with 20 for older quakus versions when the using

  <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-rest-client-reactive</artifactId>
     <version>3.6.3</version>
  </dependency>

But I must admit I'm quite lost here about what do you mean by both classic and reactive REST clients. Isn't the reactive client the default and isn't the reactive the client used when following this guide https://quarkus.io/guides/rest-client ?

If you can gimme a pom that will use the classic rest I can check what is the actual value.

@gsmet
Copy link
Member

gsmet commented Feb 6, 2025

Sorry, I forgot about this one. My point is that while you are keeping the same default for RESTEasy Classic, you are actually changing the default for RESTEasy Reactive - given they use the same config (except if I'm mistaken?).

I'm fine having the same default but we need to make sure it makes sense.

50 looks like a lot to me and I would favor 20 for both but I don't know :)

Comment from Guillaume:

The default REST Client connection pool size for RESTEasy Classic was
50, but the one for Quarkus REST is 20.
Given most of the time, the limit factor will be the responsiveness of the
server, not the speed of the implementation, I think we should be
conservative and keep the same values.

Co-authored-by: Guillaume Smet <[email protected]>
@gsmet
Copy link
Member

gsmet commented Feb 14, 2025

@weltonrodrigo I thought about it a bit more and I think you're right that we should align with 50 as the default value. I tried to be explicit in the commit comment:

The default REST Client connection pool size for RESTEasy Classic was
50, but the one for Quarkus REST is 20.
Given most of the time, the limiting factor will be the responsiveness of the
server, not the speed of the implementation, I think we should be
conservative and keep the same values.

@geoand do you agree with this analysis?

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense

@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 14, 2025
Copy link

quarkus-bot bot commented Feb 14, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit ea8bae6.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Copy link

😭 Deploy PR Preview failed.

Copy link

quarkus-bot bot commented Feb 14, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit ea8bae6.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
JVM Tests - JDK 17 Build Failures Logs Raw logs 🔍
JVM Tests - JDK 21 Build Failures Logs Raw logs 🔍
JVM Tests - JDK 17 Windows Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Tests - JDK 17 #

- Failing: extensions/resteasy-classic/resteasy-client/runtime extensions/resteasy-reactive/rest-client/runtime 
! Skipped: extensions/amazon-lambda-http/http-event-server extensions/amazon-lambda-rest/rest-event-server extensions/amazon-lambda/event-server and 60 more

📦 extensions/resteasy-classic/resteasy-client/runtime

io.quarkus.restclient.runtime.RestClientBaseTest.clientSpecificConfigs line 130 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
restClientBuilder.property(
    "resteasy.connectionPoolSize",
    103
);
-> at io.quarkus.restclient.runtime.RestClientBaseTest.clientSpecificConfigs(RestClientBaseTest.java:130)
Actual invocations have different arguments at position [1]:
restClientBuilder.baseUrl(

io.quarkus.restclient.runtime.RestClientBaseTest.globalConfigs line 176 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
restClientBuilder.property(
    "resteasy.connectionPoolSize",
    203
);
-> at io.quarkus.restclient.runtime.RestClientBaseTest.globalConfigs(RestClientBaseTest.java:176)
Actual invocations have different arguments at position [1]:
restClientBuilder.baseUrl(

📦 extensions/resteasy-reactive/rest-client/runtime

io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilderTest.clientSpecificConfigs line 142 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
quarkusRestClientBuilderImpl.property(
    "io.quarkus.rest.client.connection-pool-size",
    103
);
-> at io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl.property(QuarkusRestClientBuilderImpl.java:149)
Actual invocations have different arguments at positions [0, 1]:
quarkusRestClientBuilderImpl.baseUri(

io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilderTest.globalConfigs line 196 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
quarkusRestClientBuilderImpl.property(
    "io.quarkus.rest.client.connection-pool-size",
    203
);
-> at io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl.property(QuarkusRestClientBuilderImpl.java:149)
Actual invocations have different arguments at positions [0, 1]:
quarkusRestClientBuilderImpl.baseUri(

⚙️ JVM Tests - JDK 21 #

- Failing: extensions/resteasy-classic/resteasy-client/runtime extensions/resteasy-reactive/rest-client/runtime 
! Skipped: extensions/amazon-lambda-http/http-event-server extensions/amazon-lambda-rest/rest-event-server extensions/amazon-lambda/event-server and 60 more

📦 extensions/resteasy-classic/resteasy-client/runtime

io.quarkus.restclient.runtime.RestClientBaseTest.clientSpecificConfigs line 130 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
restClientBuilder.property(
    "resteasy.connectionPoolSize",
    103
);
-> at io.quarkus.restclient.runtime.RestClientBaseTest.clientSpecificConfigs(RestClientBaseTest.java:130)
Actual invocations have different arguments at position [1]:
restClientBuilder.baseUrl(

io.quarkus.restclient.runtime.RestClientBaseTest.globalConfigs line 176 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
restClientBuilder.property(
    "resteasy.connectionPoolSize",
    203
);
-> at io.quarkus.restclient.runtime.RestClientBaseTest.globalConfigs(RestClientBaseTest.java:176)
Actual invocations have different arguments at position [1]:
restClientBuilder.baseUrl(

📦 extensions/resteasy-reactive/rest-client/runtime

io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilderTest.clientSpecificConfigs line 142 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
quarkusRestClientBuilderImpl.property(
    "io.quarkus.rest.client.connection-pool-size",
    103
);
-> at io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl.property(QuarkusRestClientBuilderImpl.java:149)
Actual invocations have different arguments at positions [0, 1]:
quarkusRestClientBuilderImpl.baseUri(

io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilderTest.globalConfigs line 196 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
quarkusRestClientBuilderImpl.property(
    "io.quarkus.rest.client.connection-pool-size",
    203
);
-> at io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl.property(QuarkusRestClientBuilderImpl.java:149)
Actual invocations have different arguments at positions [0, 1]:
quarkusRestClientBuilderImpl.baseUri(

⚙️ JVM Tests - JDK 17 Windows #

- Failing: extensions/resteasy-classic/resteasy-client/runtime extensions/resteasy-reactive/rest-client/runtime 
! Skipped: extensions/amazon-lambda-http/http-event-server extensions/amazon-lambda-rest/rest-event-server extensions/amazon-lambda/event-server and 60 more

📦 extensions/resteasy-classic/resteasy-client/runtime

io.quarkus.restclient.runtime.RestClientBaseTest.clientSpecificConfigs line 130 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
restClientBuilder.property(
    "resteasy.connectionPoolSize",
    103
);
-> at io.quarkus.restclient.runtime.RestClientBaseTest.clientSpecificConfigs(RestClientBaseTest.java:130)
Actual invocations have different arguments at position [1]:
restClientBuilder.baseUrl(

io.quarkus.restclient.runtime.RestClientBaseTest.globalConfigs line 176 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
restClientBuilder.property(
    "resteasy.connectionPoolSize",
    203
);
-> at io.quarkus.restclient.runtime.RestClientBaseTest.globalConfigs(RestClientBaseTest.java:176)
Actual invocations have different arguments at position [1]:
restClientBuilder.baseUrl(

📦 extensions/resteasy-reactive/rest-client/runtime

io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilderTest.clientSpecificConfigs line 142 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
quarkusRestClientBuilderImpl.property(
    "io.quarkus.rest.client.connection-pool-size",
    103
);
-> at io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl.property(QuarkusRestClientBuilderImpl.java:149)
Actual invocations have different arguments at positions [0, 1]:
quarkusRestClientBuilderImpl.baseUri(

io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilderTest.globalConfigs line 196 - History - More details - Source on GitHub

Argument(s) are different! Wanted:
quarkusRestClientBuilderImpl.property(
    "io.quarkus.rest.client.connection-pool-size",
    203
);
-> at io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl.property(QuarkusRestClientBuilderImpl.java:149)
Actual invocations have different arguments at positions [0, 1]:
quarkusRestClientBuilderImpl.baseUri(

Flaky tests - Develocity

⚙️ Native Tests - HTTP

📦 integration-tests/rest-client-reactive

io.quarkus.it.rest.client.BasicTestIT.shouldCreateClientSpans - History

  • expected: <1> but was: <2> - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
	at io.quarkus.it.rest.client.BasicTest.shouldCreateClientSpans(BasicTest.java:216)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:799)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

@weltonrodrigo
Copy link
Contributor Author

@weltonrodrigo I thought about it a bit more and I think you're right that we should align with 50 as the default value. I tried to be explicit in the commit comment:

I believe you'll find this funny, but I actually though @WithDefault("50") would just document this value as being 50 in the generated documentation pages. I now understand that this actually sets the value to 50 when no user provided config is present.

This is funny because I was both wrong and right. Wrong because I wrongly interpreted the code and misunderstood the value to be 50 and right because it seems it actually should be 50.

And now this thread makes so much sense to me now.

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

Successfully merging this pull request may close these issues.

3 participants