MongoDB反应式无法发送完整的信号



我正在使用Spring webflux + mongodb。当合并多个通量的更复杂的方法返回时,我遇到了通量从未完成的问题(http 客户端被卡在等待中(。

在尝试复制时,以下似乎是问题所在:

someRepository.findAll((.subscribe([etc...](; 始终准确地发出 3855 个实体,尽管数据库中有 15228 个实体。不播放完整信号。 使用 coreSubscriber 时,当 gc 运行时,订阅者将被垃圾回收,这意味着基本上不可能仍然排队。

有谁知道此问题的原因和/或解决方法?

(在 spring-boot-starter-data-mongodb-reactive 2.0.0.RELEASE、2.0.3.RELEASE 和 2.0.4.RELEASE 版本中测试为 100% 的时间发生,假设在两者之间的版本中也发生。蒙戈版本:4.0.0(

编辑:相关代码:

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

locationRepository.findAll().subscribe(result -> log.info("RESULT "+result), error -> log.info("ERROR"+error),() -> log.info("DONE"));

这后来被证明是驱动程序中的死锁。这可以通过在配置 mongo 时使用AsyncSocketChannelStreamFactoryFactory来解决

最新更新