[CSHARP-794] When try to test connection to mongodb server, connection is hanging - need to implement a timeout mechanism Created: 09/Aug/13  Updated: 20/Mar/14  Resolved: 09/Aug/13

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Gabriel Badescu Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 x64, Windows Server 2008 R2


Attachments: File loopback.pcap     Text File mongod.log    

 Description   

I use Mongo db C# driver 1.4.0.4468.
MongoDB it is installed as a windows service an a machine.
The command that I used to install the service is : "C:\Program Files (x86)\Ixia\ResourceManager\Mongodb\bin\mongod.exe" --journal --dbpath "C:\ProgramData\Ixia\ResourceManager\Storage\Database" --logpath "C:\ProgramData\Ixia\ResourceManager\Logs\mongod.log" --service --logappend"
When Windows network setting: "Receive Window Auto-Tuning Level" it is set to "experimental" value, no connections can be made to database using C# driver. To set this value you need to open an admin cmd and type command: netsh int tcp set global autotuninglevel=experimental
After mongodb service it is installed I test connectivity with the database.
I used MongoDB.Driver.MongoServer.Connect(TimeSpan timeout) method to test if mongodb server is started. Even this method has a timeout parameter, the execution hangs in this method.
You need to fix this problem and to have a time out mechanism to throw an error if no connection can be made.
I attached mongod.log and a capture file to see the packets sent.



 Comments   
Comment by Craig Wilson [ 09/Aug/13 ]

Hi Gabriel,
Thanks for reporting. The 1.4 version of the driver is over 1 year old. The timeout mechanisms work in the current version of the driver. If you are having issues, then you'll need to upgrade as we won't be doing any fixes for the 1.4 version of the driver.

Craig

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