-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Spring Boot 3.3.5 webflux dependency causing threads to block with state of TIMED_WAITING #33912
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
Comments
Hey, sorry for the delay, if you still observe this issue with Spring Framework 6.2, could you please provide a reproducer that can allow us to reproduce the working version and the broken one? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Hi @sdeleuze, I managed to fix my issue. I'm just sharing in case this helps other. override fun filter(request
: clientRequest, next
: ExchangeFunction)
: Mono<ClientResponse> {
return Mono.just(request)
.filter{it.attribute(OAUTH2_AUTH_CLIENT_ATTR_NAME).isPresent}
.flatMap{reauthorizeClient(getOauthAuthClient(it.attributes()))}
.switchIfEmpty(Mono.defer{
Mono.just(request).flatMap{authorizeClient(this.clientRegistrationId)}
})
.map{bearer(request.requireNotNull(it))}
.flatMap{next.exchange(it)
// This is the fix. Consuming the response fully
.flatMap{response
-> response.bodyToMono(String::class.java)
.thenReturn(Response)
}}
.switchIfEmpty(Mono.dfer{next.exchange(request)})
} I'm not quite sure why this was not an issue in |
Running on:
openjdk 22.0.2
, Kotlin:2.0.21
, Spring Boot:3.3.5
, Spring Cloud:2023.0.3
.My Project is a REST API using Hikari for connection pooling. When I run many concurrent requests against my app, I can see that some connections never return to HikariPool
I got a thread dump and can see many threads are in
TIMED_WAITING
state.All the
waiting on condition
threads are running KotlinrunBloking
code in which I'm usingorg.springframework.web.reactive.function.client.WebClient
.As an example,
Note that:
3.3.5
brings inspring-webflux
version6.1.14
.3.3.4
which brings inspring-webflux
version6.1.13
.If I override
spring-webflux
in my pom back to6.1.13
everything works just fine. There are no threads inTIMED_WAITING
and HiKari pool will show active connection of0
at the end of my concurrent test.Is this a bug related to
spring-webflux
version6.1.14
?The text was updated successfully, but these errors were encountered: