Skip to content
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

Async resource cleanup failed after onComplete / call already closed #291

Open
owetterau opened this issue Feb 13, 2022 · 2 comments
Open
Labels

Comments

@owetterau
Copy link

owetterau commented Feb 13, 2022

Hello,

I ran into an issue using "spring-boot-starter-data-mongodb-reactive". When calling this server method, see two errors ("Async resource cleanup failed after onComplete", "call already closed") on the server (see attached error log). On the GRpc client I see this error: { "error": "13 INTERNAL: Half-closed without a request" }

GRpc server:

public Mono<RequestRegistrationResult> requestRegistration(Mono<RequestRegistrationData> requestRegistrationDataMono) {
  return requestRegistrationDataMono
    .flatMap(request -> registrationsService.requestRegistration(request.getEmail(), request.getPassword()))
    .map(registration -> RequestRegistrationResult.newBuilder().setRegistrationId(uuidToProtobuf(registration.getId())).build());
  );
}

Business service:

public Mono<Registration> requestRegistration(String email, String password) {
  return registrationsRepository.save(new Registration(UUID.randomUUID(), email, password, UUID.randomUUID()));
}

Repository:

@Repository
public interface RegistrationsRepository extends ReactiveMongoRepository<Registration, UUID> {}

Interestingly enough, if I rewrite the code on the server like this (which is not ideal), everything works fine:

public Mono<RequestRegistrationResult> requestRegistration(Mono<RequestRegistrationData> requestRegistrationDataMono) {
  return Mono.just(
    requestRegistrationDataMono
      .flatMap(request -> registrationsService.requestRegistration(request.getEmail(), request.getPassword()))
      .map(registration -> RequestRegistrationResult.newBuilder().setRegistrationId(uuidToProtobuf(registration.getId())).build())
      .block()
  );
}

Here is the error log:

java.lang.RuntimeException: Async resource cleanup failed after onComplete
	at reactor.core.publisher.FluxUsingWhen$CommitInner.onError(FluxUsingWhen.java:520) ~[reactor-core-3.4.14.jar:3.4.14]
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.MonoUsingWhen] :
	reactor.core.publisher.Mono.usingWhen(Mono.java:1006)
	org.springframework.data.repository.core.support.RepositoryMethodInvoker$ReactiveInvocationListenerDecorator.decorate(RepositoryMethodInvoker.java:226)
Error has been observed at the following site(s):
	*__Mono.usingWhen ⇢ at org.springframework.data.repository.core.support.RepositoryMethodInvoker$ReactiveInvocationListenerDecorator.decorate(RepositoryMethodInvoker.java:226)
	|_  Mono.doOnNext ⇢ at com.example.business.RegistrationsService.requestRegistration(RegistrationsService.java:48)
	*____Mono.flatMap ⇢ at com.example.web.GrpcRegistrationsService.requestRegistration(GrpcRegistrationsService.java:33)
	|_       Mono.map ⇢ at com.example.web.GrpcRegistrationsService.requestRegistration(GrpcRegistrationsService.java:34)
Original Stack Trace:
		at reactor.core.publisher.FluxUsingWhen$CommitInner.onError(FluxUsingWhen.java:520) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Operators.reportThrowInSubscribe(Operators.java:232) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Mono.subscribe(Mono.java:4403) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onComplete(FluxUsingWhen.java:384) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2058) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1817) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180) ~[reactor-core-3.4.14.jar:3.4.14]
		at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:165) ~[reactor-core-3.4.14.jar:3.4.14]
		at com.mongodb.reactivestreams.client.internal.MongoOperationPublisher.lambda$sinkToCallback$30(MongoOperationPublisher.java:549) ~[mongodb-driver-reactivestreams-4.4.1.jar:na]
		at com.mongodb.reactivestreams.client.internal.OperationExecutorImpl.lambda$execute$9(OperationExecutorImpl.java:124) ~[mongodb-driver-reactivestreams-4.4.1.jar:na]
		at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.operation.CommandOperationHelper.lambda$exceptionTransformingCallback$23(CommandOperationHelper.java:632) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:95) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.RetryingAsyncCallbackSupplier$RetryingCallback.onResult(RetryingAsyncCallbackSupplier.java:114) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:95) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:95) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$executeBulkWriteBatchAsync$11(MixedBulkWriteOperation.java:427) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:84) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:61) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.LoopState.breakAndCompleteIf(LoopState.java:111) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$executeBulkWriteBatchAsync$10(MixedBulkWriteOperation.java:378) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:82) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:61) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$executeBulkWriteBatchAsync$9(MixedBulkWriteOperation.java:400) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:280) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:84) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:687) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:159) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:526) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:503) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:815) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:782) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:650) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:319) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:266) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection.readAsync(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection.access$600(InternalStreamConnection.java:86) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:772) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:757) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:650) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:319) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:347) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream.access$1100(NettyStream.java:105) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:421) ~[mongodb-driver-core-4.4.1.jar:na]
		at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:418) ~[mongodb-driver-core-4.4.1.jar:na]
		at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
		at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: java.lang.IllegalStateException: call already closed
	at com.google.common.base.Preconditions.checkState(Preconditions.java:502) ~[guava-31.0.1-jre.jar:na]
	at io.grpc.internal.ServerCallImpl.closeInternal(ServerCallImpl.java:214) ~[grpc-core-1.44.0.jar:1.44.0]
	at io.grpc.internal.ServerCallImpl.close(ServerCallImpl.java:207) ~[grpc-core-1.44.0.jar:1.44.0]
	at io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.onError(ServerCalls.java:389) ~[grpc-stub-1.44.0.jar:1.44.0]
	at com.salesforce.reactorgrpc.stub.ServerCalls.lambda$oneToOne$1(ServerCalls.java:49) ~[reactor-grpc-stub-1.2.3.jar:na]
	at reactor.core.publisher.LambdaMonoSubscriber.doError(LambdaMonoSubscriber.java:155) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.LambdaMonoSubscriber.onNext(LambdaMonoSubscriber.java:176) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached(MonoCacheTime.java:337) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext(MonoCacheTime.java:354) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoUsingWhen$MonoUsingWhenSubscriber.deferredComplete(MonoUsingWhen.java:268) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxUsingWhen$CommitInner.onComplete(FluxUsingWhen.java:527) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Mono.subscribe(Mono.java:4400) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onComplete(FluxUsingWhen.java:384) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2058) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1817) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.4.14.jar:3.4.14]
	at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:165) ~[reactor-core-3.4.14.jar:3.4.14]
	at com.mongodb.reactivestreams.client.internal.MongoOperationPublisher.lambda$sinkToCallback$30(MongoOperationPublisher.java:549) ~[mongodb-driver-reactivestreams-4.4.1.jar:na]
	at com.mongodb.reactivestreams.client.internal.OperationExecutorImpl.lambda$execute$9(OperationExecutorImpl.java:124) ~[mongodb-driver-reactivestreams-4.4.1.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.operation.CommandOperationHelper.lambda$exceptionTransformingCallback$23(CommandOperationHelper.java:632) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:95) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.RetryingAsyncCallbackSupplier$RetryingCallback.onResult(RetryingAsyncCallbackSupplier.java:114) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:95) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackSupplier.lambda$whenComplete$1(AsyncCallbackSupplier.java:95) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$executeBulkWriteBatchAsync$11(MixedBulkWriteOperation.java:427) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:84) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:61) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.LoopState.breakAndCompleteIf(LoopState.java:111) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$executeBulkWriteBatchAsync$10(MixedBulkWriteOperation.java:378) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:82) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.function.AsyncCallbackLoop$LoopingCallback.onResult(AsyncCallbackLoop.java:61) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$executeBulkWriteBatchAsync$9(MixedBulkWriteOperation.java:400) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:280) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:84) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:687) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:159) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:48) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:526) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:503) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:815) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:782) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:650) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:319) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:266) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.readAsync(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.access$600(InternalStreamConnection.java:86) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:772) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:757) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:650) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:647) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:319) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:347) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream.access$1100(NettyStream.java:105) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:421) ~[mongodb-driver-core-4.4.1.jar:na]
	at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:418) ~[mongodb-driver-core-4.4.1.jar:na]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.73.Final.jar:4.1.73.Final]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

Does anybody know why this is happening and how I can get rid of the blocking part?

@rmichela
Copy link
Collaborator

rmichela commented Mar 24, 2022

Could this be in any way related to #292? Does using the patch from PR #293 fix your issue?

@bruto1
Copy link
Contributor

bruto1 commented Mar 24, 2022

I don't think it is

@rmichela rmichela added the bug label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants