You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A web application developed using Spring Boot 2.0 (snapshot) and Spring 5 Web Reactive using Netty as a server, outputs an amount of data in JSON format.
It uses Spring Boot 2.0 and Spring 5 Web Reactive. The dependencies have been modified in order to use Netty as a server instead of Apache Tomcat.
The application contains a @RestController which has a controller method returning a Flux<Entity>.
The sample application can be started with mvn -U clean compile spring-boot:run, and it can be called like curl http://localhost:8080/list/SIZE, being SIZE the size of the list of elements to be returned.
Observed results
When running this application on Windows 10, if we request 41 elements everything goes alright, because the output size is 1969 bytes (less than 2 KBytes):
$ curl http://localhost:8080/list/41 > out
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1969 0 1969 0 0 63516 0 --:--:-- --:--:-- --:--:-- 128k
...but if we request 50 elements:
$ curl http://localhost:8080/list/50 > out1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2017 0 2017 0 0 13 0 --:--:-- 0:02:28 --:--:-- 0
^C (Interrupted)
Apparently, the server hangs when it needs to flush output data that exceeds 2048 bytes.
I've tested this on two different Windows 10 machines with the same result. Also, I've tested that this works OK on both MacOS 10.10 and Linux Ubuntu 16.
Note that, given this seems to involve the Netty output buffers, it might be related to #19662
Indeed, there were a few identified reactor netty issues related to buffering and flushing of the response body; so I've waited for those to be resolved and checked again: everything works out now (tested on windows 7 against the latest Spring Boot SNAPSHOTs).
Thanks for raising this issue and sorry for the late reply!
Uh oh!
There was an error while loading. Please reload this page.
Daniel Fernández opened SPR-15108 and commented
Scenario
A web application developed using Spring Boot 2.0 (snapshot) and Spring 5 Web Reactive using Netty as a server, outputs an amount of data in JSON format.
Implementation
The test-boot-netty-windows repository (tag
spr15108
) contains a test application initialised using http://start.spring.io.It uses Spring Boot 2.0 and Spring 5 Web Reactive. The dependencies have been modified in order to use Netty as a server instead of Apache Tomcat.
The application contains a
@RestController
which has a controller method returning aFlux<Entity>
.The sample application can be started with
mvn -U clean compile spring-boot:run
, and it can be called likecurl http://localhost:8080/list/SIZE
, beingSIZE
the size of the list of elements to be returned.Observed results
When running this application on Windows 10, if we request 41 elements everything goes alright, because the output size is 1969 bytes (less than 2 KBytes):
...but if we request 50 elements:
Apparently, the server hangs when it needs to flush output data that exceeds 2048 bytes.
I've tested this on two different Windows 10 machines with the same result. Also, I've tested that this works OK on both MacOS 10.10 and Linux Ubuntu 16.
Note that, given this seems to involve the Netty output buffers, it might be related to #19662
Affects: 5.0 M4
Reference URL: https://github.com/danielfernandez/test-boot-netty-windows/tree/spr15108
The text was updated successfully, but these errors were encountered: