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
WebClient resultMono.block() blocks application if called from RestController [SPR-16186] #20734
Comments
Rossen Stoyanchev commented Why are you blocking? Really not a good idea on a server with 4 threads which are also shared with the WebClient by default. From what I can see the response from |
Semen Goryachkin commented Thanks for your reply. I understand your comments about the blocking is bad practis and about shared WebClient.
This is reproduced in the RestController handler only. For example this code works good:
|
Rossen Stoyanchev commented I can no longer reproduce this with Boot 2.0.0.BUILD-SNAPSHOT (Reactor Netty 0.7.3 snapshot). I tried both with and without the trailing slash. On the startup the PostConstruct method completes the 4 requests, and after that I use curl from the command line to send several more to "/people1/{id}". There were a lot of issues resolved in Reactor 0.7.2 and 0.7.3 so this is not unexpected. |
Semen Goryachkin opened SPR-16186 and commented
WebClient resultMono.block() blocks application if called from RestController.
In this case the browser does not receive a response from the server and the application stops responding to requests.
Example:
Full example code (simple boot app): https://github.com/sgoryachkin/webclient-example
System: Google Chrome, Windows 7, JDK 1.8
Log:
Affects: 5.0.1
Reference URL: https://github.com/sgoryachkin/webclient-example/blob/master/src/main/java/org/sego/webclient/example/WebClientController.java
Issue Links:
The text was updated successfully, but these errors were encountered: