-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
Hi,
I am currently looking into using the jetty httpclient to replace netty for my Spring Webclient which is responsible for external calls. As there is a hard limit when these external requests shall be cancelled, I am using a timeout in the Webclient execution call:
ResponseEntity<String> response = request.retrieve()
.toEntity(String.class)
.timeout(Duration.ofMillis(timeoutMillis))
.block();
I am using Jetty as ClientHttpConnector, simplified:
HttpClient httpClient = new HttpClient(SSL_CONTEXT_FACTORY);
WebClient.builder()
.clientConnector(new JettyClientHttpConnector(httpClient))
...
In a load test scenario where all calls are cancelled before it can finish, I am observing a thread leak on the Jetty HttpClient Threads:
Even after a long cooldown they are not coming back. And at the peak new requests are failing due to no free resources.
Caused by: java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
at java.base/java.lang.Thread.start0(Native Method)
at java.base/java.lang.Thread.start(Thread.java:804)
at org.eclipse.jetty.util.thread.QueuedThreadPool.startThread(QueuedThreadPool.java:660)
manolvalchev and tsvetan-angelov
Metadata
Metadata
Assignees
Labels
No labels