[CSHARP-1231] Expose Server Selection Timeout via Connection String and MongoClientSettings Created: 06/Apr/15  Updated: 20/Jan/16  Resolved: 01/May/15

Status: Closed
Project: C# Driver
Component/s: Configuration
Affects Version/s: 2.0
Fix Version/s: 2.1

Type: Improvement Priority: Major - P3
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
related to CSHARP-1018 Driver ignores timeout option when ma... Closed

 Description   

Currently, ServerSelectionTimeout is configurable via ClusterSettings in Core, but that has not been exposed into the high level API either via connection string or via MongoClientSettings.



 Comments   
Comment by Githook User [ 01/May/15 ]

Author:

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

Message: CSHARP-1231: Exposing ServerSelectionTimeout as a top-level setting.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/fb857847347a93617b24653f3ca8336b375ebb4d

Comment by Robert Stam [ 16/Apr/15 ]

While we don't specifically have a knob for ServerSelectionTimeout, there is a general purpose knob that can be used to configure anything in the cluster.

For example, the ServerSelectionTimeout could be configured like this:

var clientSettings = new MongoClientSettings
{
    Server = new MongoServerAddress("localhost", 27017),
    ClusterConfigurator = builder =>
    {
        builder.ConfigureCluster(settings => settings.With(serverSelectionTimeout: TimeSpan.FromSeconds(2)));
    }
};
var client = new MongoClient(clientSettings);

This workaround is only available in code. To set the ServerSelectionTimeout via the connection string requires changes to the driver.

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