TA的每日心情 | 开心 2024-02-17 18:16 |
---|
签到天数: 14 天 [LV.3]偶尔看看II
管理员
这里没有广告...
- 积分
- 10709
|
MongoDB.Driver.MongoConnectionException: Unable to connect to the primary member of the replica set: Too many threads are already waiting for a connection..
C# Driver:1.3.1
Replset:
localhost:10001 (primary)
localhost:10002 (member)
I have initReplset and add localhost:10002 to the replset,
Then I create a new connection.When I try to connect,the exception happened.
If slaveOk of this connection setting is true.
Stack:
MongoDB.Driver.MongoConnectionException: Unable to connect to any slaveOk
member of the replica set: Too many threads are already waiting for a
connection.. ---> MongoDB.Driver.MongoConnectionException: Too many threads
are already waiting for a connection.
at
MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection(MongoDatabase
database)
at MongoDB.Driver.MongoServerInstance.Connect(Boolean slaveOk)
at MongoDB.Driver.Internal.ReplicaSetConnector.ConnectWorkItem(Object
argsObject)
--- End of inner exception stack trace ---
at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout,
ConnectWaitFor waitFor)
at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor
waitFor)
at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
at MongoDB.Driver.MongoServer.Connect()
at
MagicMongoDBTool.Module.MongoDBHelper.FillConnectionToTreeView(TreeView
trvMongoDB) in C:\Work
Shop\MagicMongoDBTool\MagicMongoDBTool\Module\MongoDBHelper\MongoDBHelper_Connection_Present.cs:line
63
If I modify the SlaveOK to false:
MongoDB.Driver.MongoConnectionException: Unable to connect to the primary
member of the replica set: Too many threads are already waiting for a
connection.. ---> MongoDB.Driver.MongoConnectionException: Too many threads
are already waiting for a connection.
at
MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection(MongoDatabase
database)
at MongoDB.Driver.MongoServerInstance.Connect(Boolean slaveOk)
at MongoDB.Driver.Internal.ReplicaSetConnector.ConnectWorkItem(Object
argsObject)
--- End of inner exception stack trace ---
at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout,
ConnectWaitFor waitFor)
at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor
waitFor)
at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
at MongoDB.Driver.MongoServer.Connect()
at
MagicMongoDBTool.Module.MongoDBHelper.FillConnectionToTreeView(TreeView
trvMongoDB) in C:\Work
Shop\MagicMongoDBTool\MagicMongoDBTool\Module\MongoDBHelper\MongoDBHelper_Connection_Present.cs:line
63
But there is not any application access to the server.
OK,WaitQueueSize is need.
|
|