-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
spring webflux ServerRequest.bodyToMono().block will freeze for HTTP post request whose header size + body size > 1024 [SPR-16579] #21121
Comments
Brian Clozel commented What Reactor Netty version are you using? Could you try the following commands and let me know about the result?
Thanks! |
Yang Wang commented The latest boot release version |
Brian Clozel commented Could you answer my other questions as well? |
Yang Wang commented I will update with details a moment later. |
Yang Wang commented
|
Yang Wang commented
|
Yang Wang commented component version: |
Rossen Stoyanchev commented This looks like a duplicate of #20757. The default assumption in a WebFlux application is that there will be no blocking. That said for a single request it probably shouldn't hang. A follow-up improvement for reactor/reactor-netty#293 might be needed. My guess is that the blocking prevents Reactor Netty from responding, so let's see where reactor/reactor-netty#305 goes. |
Brian Clozel commented In the meantime Yang Wang, you can use the following code snippet works and is more in line with what's expected from a reactive application. @Bean
public RouterFunction<ServerResponse> rf() {
return route(
POST("/test"), req -> {
return req.bodyToMono(String.class)
.doOnNext(body -> System.out.println(body))
.then(ServerResponse.ok().body(Mono.just("ok"), String.class));
}
);
} |
Oleg Schelykalnov commented It looks like applications based on RestController affected too. |
Brian Clozel commented I'm closing this issue as it's mainly duplicating other issues in Spring Framework and Reactor Netty that are now solved. If you still face this problem, please reopen this issue with a sample application that consistently reproduce the problem. Thanks! |
Rossen Stoyanchev commented Effectively this issue superseded by Reactor Netty #305 which reproduces the same issue without WebFlux. |
Oleg Schelykalnov commented There is a example project: https://github.com/olegshtch/webflux-security Test query:
|
Brian Clozel commented This looks like a totally different issue - the request body you're suggesting here is not > 1024. |
Oleg Schelykalnov commented Yep, it works under Tomcat. |
Rossen Stoyanchev commented Fresh ticket and description please |
Yang Wang opened SPR-16579 and commented
Affects: 5.0.4
Issue Links:
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: