This is issue is still reproducible with latest release :
reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException: Pool#acquire(Duration) has been pending for more than the configured timeout of 45000ms
at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.run(AbstractPool.java:361)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ Request to POST http://localhost:8444/testaddress [DefaultWebClient]
Stack trace:
at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.run(AbstractPool.java:361)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
got response
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Release version : spring boot version : 2.3.3.RELEASE reactor core: 3.3.9-RELEASE reactor-netty : 0.9.11.RELEASE
ClientHttpConnector httpConnector =new ReactorClientHttpConnector(HttpClient.create().compress(true)));
Webclient client = webClientBuilder.clientConnector(httpConnector).baseUrl(baseURL).build();
API calling in loop for 300,000 times
client
.post()
.uri(uri) // local URL
.bodyValue(rq)
.exchange()
.flatMap(
r -> {
if (!r.statusCode().is2xxSuccessful()) {
...
Server is returning dummy response , not much processing for testing purpose.
Note : If we induce 200-300 ms time latency on server side then this issue can be reproduced with lesser number of loop count.
Comment From: philwebb
I suspect you are performing some kind of blocking call in your handler code. 200-300 ms latency in the event loop would indeed cause timeouts. I don't think this is a Spring Boot bug, but if you can provide a minimal reproducible example that we can download and run we'll be able to tell if there's a bug in WebFlux, Reactor Netty or Netty itself.
Comment From: prasannajoshi2121
@philwebb please find minimal reproducible example repo
Client App - https://github.com/prasannajoshi2121/spring-test-client.git Server App - https://github.com/prasannajoshi2121/test-vertx-server.git
inside Client App repo , src/main/resource directory please find Httprequest.JMX script.
(Path - spring-test-client/first-project/src/main/resources/HTTP Request.jmx)
Please run JMX script to reproduce issue once Client and server started. After 45 sec , we will start getting above error
Comment From: philwebb
Duplicates #23255. Please see answer in that issue.