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
ConnectableFlux changes behavior between 3.2 and 3.3 #2028
Comments
Can you try with |
I've tried but I don't know if I follow the right path to add to my spring-boot application the I've created a branch and set up a CI on it with this, the bug still occurs 😅.
To try the SNAPSHOT version, I had to the pom.xml: ...
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.3.3.BUILD-SNAPSHOT</version>
</dependency>
...
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories> The diff is available here: https://gitlab.com/davinkevin/issue-after-upgrade-to-3-3-2/-/compare/master...reactor-3-3-3-BUILD-SNAPSHOT |
Yes that seems correct. In any case, the previous fix indeed didn't help your case. I have found a fix for your particular issue. Also since there are multiple issues around that initial regression, I opened a tracking issue: #2030 |
This commit ensures that Flux.replay falls back to the 3.2.x behavior of requesting Long.MAX_VALUE when no early subscriber emitted requests before the `connect()`. Also fixes #2028
For information, as a bypass we switched from replay(1) to cache(1) and it seems to be working just fine. |
And we use a |
This commit ensures that Flux.replay falls back to the 3.2.x behavior of requesting Long.MAX_VALUE when no early subscriber emitted requests before the `connect()`. Also fixes #2028
@TheoCadoret @davinkevin the fix has been merged and is available in |
@simonbasle indeed tests run really smoothly with this one. Thanks for reactivity ! |
CI of demo project ends well too 🤩
Thanks, I hope this release will be include in spring boot soon. |
During an upgrade, I discover a very behavior change on the object
ConnectableFlux
. I've checked all changelogs between 3.2.x and 3.3.x, but without any success from my point of view.I've set up a project with CI ready. You can compare the result of each builds on the
pipeline view
hereThe main problem seems to be linked to the
replay(1)
operator I use to have a flux with always at least a value. At the construction of the bean, I trigger (from the constructor) theConnectableFlux#connect
method.All the tests were ok, but with the migration to Reactor 3.3.2 (due to spring boot 2.2.4), I found a problem with this code.
The flux with the
replay(1)
operator seems to only emit the first value and nothing more.The example I use in the repository is made with a
TokenProvider
with the following code (I've modified it to make it more testable, not real production code 😅):I've removed here all
log()
operator and logs from the code. You can find the real version hereI've included 4 unit tests on this code, which all fail on reactor-core 3.3.2.
Like before, I've removed some code for brevity, you can find real code here
Expected Behavior
I was expecting the code and test to behave like in the 3.2.x : see tests results
The replay should keep the last value when used as
replay(1)
and should not prevent new value to be published in the flux.Actual Behavior
The current behavior could be seen here in the CI in 3.3.2: see tests results
The replay doesn't work like before and prevent new value to be published.
Steps to Reproduce
All the code is available here
Possible Solution
Don't know... a bug in the ConnectableFlux or wrong usage of the API, but I don't think so 😅.
Your Environment
netty
, ...): All is available in the pom xml in the projectjavar -version
): Java 11.0.5uname -a
): MacOS, Linux/cc @TheoCadoret
The text was updated successfully, but these errors were encountered: