[CSHARP-1264] Wait Queue Size setting doesn't affect the server selection wait queue size. Created: 30/Apr/15  Updated: 21/Dec/15  Resolved: 07/May/15

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.0.1, 2.1

Type: Bug Priority: Critical - P2
Reporter: Craig Wilson Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-1144 Investigate tests busting over the wa... Closed

 Description   

Currently, the wait queue size doesn't affect the server selection wait queue size. We either need to start setting it, or determine a different way to handle queuing (or lack thereof) in the server selection loop.

Workaround

const int maxWaitQueueSize = 5000; // set this to a value that is appropriate
var settings = new MongoClientSettings();
 
settings.WaitQueueSize = maxWaitQueueSize;
 
// this is the workaround for the bug.
settings.ClusterConfigurator = cb =>
{
	cb.ConfigureCluster(cs => cs.With(maxServerSelectionWaitQueueSize = maxWaitQueueSize ));
};



 Comments   
Comment by Craig Wilson [ 16/Dec/15 ]

It can be set on the connection string as well. The option name is waitQueueSize. Alternatively, you can set the waitQueueMultiple.

Comment by Bret Ferrier [ 16/Dec/15 ]

So reading this it isn't quite clear how you can set this using 2.1 or 2.2 versions of the driver. Can you just add the option to the connection string like so?

&maxWaitQueueSize=5000

Or does it have to be done in code?

Comment by Githook User [ 07/May/15 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-1264: WaitQueueSize setting did not affect the server selection wait queue.

Conflicts:
src/MongoDB.Driver/ClusterRegistry.cs
Branch: v2.0.x
https://github.com/mongodb/mongo-csharp-driver/commit/a6e16e9ad07c1e70c7d2b588f2c92942554caa73

Comment by Githook User [ 07/May/15 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-1264: WaitQueueSize setting did not affect the server selection wait queue.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/3950e1416619bab14bced2c316d26cf1f75a9481

Generated at Wed Feb 07 21:39:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.