0

I'm using spring webflux + mongodb. When a more complex method that merged multiple fluxes returned, I ran into the issue of the flux never completing (the http client being stuck waiting).

In trying to reproduce, the following seems to be the issue:

someRepository.findAll().subscribe([etc...]); Always emits exactly 3855 entities, despite there being 15228 entities in the database. The complete signal is not played. When using a coreSubscriber, the subscriber will be garbage collected when the gc runs, meaning there is basically no way anything was still queued up.

Does anyone know the reason and or a workaround for this issue?

(Tested to happen 100% of the time in versions spring-boot-starter-data-mongodb-reactive 2.0.0.RELEASE, 2.0.3.RELEASE and 2.0.4.RELEASE, assumed to happen in the versions inbetween too. Mongo version: 4.0.0)

Edit: Relevant code:

public interface LocationRepository extends ReactiveMongoRepository<Location, String> {}

and

locationRepository.findAll().subscribe(result -> log.info("RESULT "+result), error -> log.info("ERROR"+error),() -> log.info("DONE"));
2
  • Please include the relevant bit of code. In it's current form your question is very hard to answer. Commented Aug 16, 2018 at 11:43
  • @Hintham all code needed was basically present. added the two lines needed, it seems to have been some issue with the database data. Commented Aug 16, 2018 at 11:47

1 Answer 1

1

This later turned out to be a deadlock in the driver. This can be resolved by using the AsynchronousSocketChannelStreamFactoryFactory when configuring mongo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.