MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

MongoDB connection is going to hang state

Hi All,

I am getting below exception while running my query using Mongo java driver 3.11.0.
More information: Using mongo 4.0

And i am fetching the query using batch size like below in java

AggregateIterable documents = collection.aggregate(aggregtes).batchSize(BATCH_SIZE).allowDiskUse(true);

Exception:

Thread Name:http-nio-10.130.88.13-8080-exec-2 ID:196 Time:Sat Mar 14 09:28:41 PDT 2020 State:RUNNABLE Priority:5 java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.socketRead(SocketInputStream.java:116) java.net.SocketInputStream.read(SocketInputStream.java:171) java.net.SocketInputStream.read(SocketInputStream.java:141) com.mongodb.internal.connection.SocketStream.read(SocketStream.java:109) com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:580) com.mongodb.internal.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:445) com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:299) com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:259) com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:99) com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:450) com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:72) com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:218) com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:269) com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:131) com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:123) com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:260) com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:138) com.mongodb.client.internal.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:54)

Could you please provide your inputs on the above exception. Any answer will be helpful for me .

Thanks
Eswar