-
Notifications
You must be signed in to change notification settings - Fork 38.5k
WebClient .retrieve() + bodyToMono() causes "Only one connection receive subscriber allowed" on 4xx and 5xx [SPR-17615] #22147
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
Brian Clozel commented What is the Could you provide us with a small project we can run? |
Vladislav Kisel commented This is an extension from reactor-test, the same as: StepVerifier.create(WebClient.builder().build().get()
.uri("https://jira.atlassian.com/rest/api/latest/issue/QWERTY-123")
.retrieve()
.bodyToMono(String::class.java))
.expectError(WebClientResponseException::class.java)
.verify() I believe Spring test will illustrate it as well: WebClientIntegrationTests#shouldGetErrorSignalOn404 |
Brian Clozel commented Thanks for the pointer indeed, I forgot about that one. I've tried to reproduce this but couldn't. I'm using Spring Boot 2.1.1.RELEASE (with Framework 5.1.3.RELEASE), reactor-netty 0.8.3.RELEASE and Kotlin 1.3.11. My test is green and I'm getting the following log:
Do you have a sample project that I can run to reproduce this? |
Vladislav Kisel commented Sure, https://github.com/encircled/reactive-jira-client - MockTest class
P.S. hotspot 1.8_152, MacOS |
Brian Clozel commented Ignore me Vladislav Kisel, this is a duplicate of #22096 which is already fixed for the next Spring Framework version. Thanks! |
Vladislav Kisel commented Oh, great. Sorry have not found that one myself Thanks |
Uh oh!
There was an error while loading. Please reload this page.
Vladislav Kisel opened SPR-17615 and commented
On 4xx and 5xx status, using WebClient "retrieve" + "bodyTo..." causes swallowed exception:
Example (kotlin):
Probably exception handler subscribes to the connection itself so "bodyTo..." causes this exception.
Anyway, WebClientResponseException is being correctly thrown and IllegalStateException is just swallowed and printed to the output
Affects: 5.1.3
Issue Links:
The text was updated successfully, but these errors were encountered: