Closed spring-projects-issues closed 6 years ago
Mark Paluch commented
We decided to create indexes without blocking retaining most of the current functionality. Indexes are created asynchronously by subscribing to index creation publishers and optionally handing in an error callback (Consumer<Throwable>
. Index creation failures no longer fail template API calls/creation as there's no execution path dependency anymore
Mark Paluch commented
Not sure about backporting to 2.0.x. The issue is quite severe but on the other hand, we're breaking behavior to some extend
KimJohn Quinn commented
Just adding to the comments since this relates closest to my issue...
Reactive calls using a reactive repository hang on the first attempt then subsequent attempts work.
This is a follow-up comment, for anyone's benefit, to a conversation posted on GitHub.
When using the Reactive Mongo API to find a record I had a reactive handler that "seemed" to hang on the first call and then subsequent calls work fine. I turned on all of the logging and noticed in the logs the first call hanging where the index creation was happening. Follow-up calls did not run the index creation and worked fine.
In this case, it was because the class I was inheriting from still used @Index
annotations. Commenting those out fixed the issue and my calls works
Mark Paluch commented
KJQ – That issue is fixed with 2.1 M3. Have you tried using the new milestone release? (Please upgrade Spring Data Commons and the driver version as well)
Mark Paluch opened DATAMONGO-1928 and commented
ReactiveMongoTemplate
reusesMongoPersistentEntityIndexCreator
which follows an imperative (blocking) programming model. This requires wrapping ofReactiveIndexOperations
in a blocking API and usage of.block()
methods.Calling blocking methods from within an application container thread (e.g. netty via Spring Boot) causes the application to hang forever as the event loop is blocked.
Ideally, indexes are created without blocking the application while retaining index creation for initial entities and on the fly
Affects: 2.0.6 (Kay SR6)
Issue Links:
DATAMONGO-1919 Decouple reactive mongo bits from blocking MongoClient ("is depended on by")
DATAMONGO-2100 Blocking operation restriction for Reactor Netty threads
DATAMONGO-1930 Reactive mongo hangs with inheritance hierarchies defined in different gradle project
Referenced from: pull request https://github.com/spring-projects/spring-data-mongodb/pull/550