[JAVA-5043] Database not being dropped using reactor-bom 2022 Created: 27/Jun/23 Updated: 27/Oct/23 Resolved: 28/Jun/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Christoph Ahlers | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
SummaryThe database cannot be dropped via mongodb-driver-core 4.9.1 and reactor-bom 2022.0.8 (and before) while it works with reactor-bom 2020.0.x. The subscription's methods are not called and the database is not dropped. It works fine with any version of reactor-bom 2020 like the current one 2020.0.33. Tested via Spring Boot 3.1.1, Testcontainers 1.18.3, Java 20.0.1, MongoDB container "mongo:6.0" (= should be standalone).
How to ReproduceExample project: github demo project You can switch the reactor-bom version via enabling a property overriding the version defined by Spring. 2022.0.x will run into a timeout via Awaitility.
Additional Background- |
| Comments |
| Comment by Christoph Ahlers [ 27/Jun/23 ] | |||||||||||||||||||||||||
|
That clears that up! Thank you! The issue can be closed! | |||||||||||||||||||||||||
| Comment by Ross Lawley [ 27/Jun/23 ] | |||||||||||||||||||||||||
|
Hi c.ahlers@gmx.net, Thanks for the ticket. This does highlight a difference in behaviour with project reactor versions. All publishers from the mongodb-driver-reactivestreams are implemented as cold Publishers. They shouldn't emit any values until demand has been signalled by their Subscription. However, internally the MongoDB Reactive Streams driver utilizes Project Reactor and relies on it to provide correctness with regards to the Reactive Stream specification.
Project Reactor version 3.5.0 which relates to 2022.0.0 has various improvements and one relating to the change in behaviour observed here is:
This change better matches the Reactive Stream specification. Updating your code to use the following subscriber and signal demand will work as expected:
I hope that helps. Ross | |||||||||||||||||||||||||
| Comment by Christoph Ahlers [ 27/Jun/23 ] | |||||||||||||||||||||||||
|
mongodb-driver-core 4.9.1 imports reactor-bom 2022.0.0, but it looks like it is not fully compatible with it | |||||||||||||||||||||||||
| Comment by PM Bot [ 27/Jun/23 ] | |||||||||||||||||||||||||
|
Hi c.ahlers@gmx.net, thank you for reporting this issue! The team will look into it and get back to you soon. |