-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Spring webflux stream fails silently #12970
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
I can't seem to reproduce the issue you're describing here. Several issues were recently fixed in reactor-netty, so you might want to try with Spring Boot <repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories> Also, does it happen still if you change the Flux generation to be: Flux<DecimalList> testClassFlux = Flux.generate(sink -> sink.next(new DecimalList())); Thanks! |
Thanks for looking into this. In terms of versions, this has been seen on both redhat linux and windows 7: Linux xxxxxx 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux (java version "1.8.0_144") I've also included the java version for each. I'll try your suggestions and report back. |
I tried both suggestions above, using snapshot build and modifying the Flux generation, and still experiencing the same issue. |
Thanks for the quick answer - I've managed to reproduce that in a Docker image. In the meantime, feel free to add Tomcat, Undertow or Jetty to your project, I've confirmed this scenario works once you've added: <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency> I'll ping back here once I've narrowed down the issue. Thanks! |
Great, that is good news that you are able to reproduce the issue! I can also confirm that this scenario works after switching to Tomcat, both with this demo and in our application. This should keep us going for now. Let me know when a fix is available and I can try it out. Thanks. |
I can't reproduce this issue with the latest Reactor SNAPSHOTs. This must have been fixed in a recent commit. Taking your sample project and adding the following property fixes the issue (I also tried with Spring Boot 2.0.2.BUILD-SNAPSHOT and 2.1.0.BUILD-SNAPSHOT and both are fine):
Can you try and confirm this fixes the issue (make sure to run |
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. |
Apologies for the delay getting back to you. I'm currently struggling to pull in the BUILD-SNAPSHOT you have listed above. We use a proxy nexus server and this is complaining when I point it to http://repo.spring.io/snapshot/. The administrator is telling me this is down to nexus expecting a maven-metadata.xml file in the root of this location which it can't find. Does this sound plausible? I've also tried this in my home setup using both windows 7 and windows 10 but I'm unable to reproduce the original problem on these environments. |
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. |
We are using spring webflux in a real world banking application to stream back data from a mongo repository. The evaluation and initial development was carried out against spring-boot-starter-parent version 2.0.0.M6. Following an upgrade to 2.0.1.RELEASE we are now experiencing an issue with one of the streams where the response will stop returning data mid-stream, and without hanging up. There are no exceptions reported in the logs. The connection simply remains open until the client times out. It took a while to track down what might be causing it, but it seemed to always occur mid-way through serializing a data item that contains large lists of BigDecimal items. This is however not deterministic, evern when dealing with fixed and ordered data sets. It does however usually occur within a given range e.g. after between 1.2 and 1.3GB
Using these clues I was able to knock together a basic application which replicates the issue in a standalone manner (generated using Spring Initializr)
Here are the main classes in the app - source is attached
stream-error-demo.ZIP
:
pom.xml
RouterConfig.java
TestHandler.java
Fire up the spring boot application and invoke the handler using curl:
The handler will continue emitting DecimalList items indefinitely.
With the spring-boot-starter-parent set to 2.0.1.RELEASE, the following behaviour is observed:
Where the speed soon drops to zero, but the stream does not terminate. There are also no errors reported in the logs.
Changing this to 2.0.0.M6, the stream continues indefinitely as expected e.g.
Please let me know if there is any further information that will help in reproducing this issue.
The text was updated successfully, but these errors were encountered: