-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Connection Management
-
None
This can happen when a Connection method throws an exception that requires the Server to be invalidated. If the Server instance has been closed by the time the exception is thrown (e.g. due to a previous exception or an SDAM event), the invalidate method will throws IllegalStateException because the pool is closed.
- In the synchronous driver, this exception will mask the underlying exception
- In the asynchronous driver, this exception will prevent the application callback from being invoked
[2018/12/28 11:09:32.400] 16:09:32.337 [nioEventLoopGroup-14-4] WARN org.mongodb.driver.connection - Got socket exception on connection [connectionId\{localValue:53, serverValue:62}] to localhost:27017. All connections to localhost:27017 will be closed. [2018/12/28 11:09:32.400] 16:09:32.338 [nioEventLoopGroup-14-4] ERROR org.mongodb.driver.connection - Callback onResult call produced an error [2018/12/28 11:09:32.400] java.lang.IllegalStateException: state should be: open [2018/12/28 11:09:32.400] at com.mongodb.assertions.Assertions.isTrue(Assertions.java:70) ~[mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.DefaultServer.invalidate(DefaultServer.java:125) ~[mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.DefaultServer.handleThrowable(DefaultServer.java:163) ~[mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.DefaultServer.access$600(DefaultServer.java:45) ~[mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:223) ~[mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:83) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:461) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:111) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:377) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:372) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:619) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:609) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.internal.connection.InternalStreamConnection$5.failed(InternalStreamConnection.java:516) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:229) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:263) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.connection.netty.NettyStream.access$800(NettyStream.java:69) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.connection.netty.NettyStream$OpenChannelFutureListener$1.operationComplete(NettyStream.java:404) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na] [2018/12/28 11:09:32.400] at com.mongodb.connection.netty.NettyStream$OpenChannelFutureListener$1.operationComplete(NettyStream.java:401) [mongodb-driver-core-3.10.0-SNAPSHOT.jar:na]