[CSHARP-4007] maxIdleTimeMS does not work as expect Created: 05/Jan/22 Updated: 27/Oct/23 Resolved: 13/Jan/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | A B | Assignee: | Robert Stam |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
In my project, I defined connectionString consists of MaxIdleTimeMS Property but some time max connection Idle time out does not work correctly as expect. below is describle of test pattern i have executed: context: current connections number: 1 the curren connections number still 1 (as expect) when I setting MaxIdleTimeMS=5 and operation screen to establish connection to DB the curren connections number : 2 (increase 1) I don't know whether somewhere in C# driver source code has overwrite MaxIdleTimeMS value or not but, I can't accurately adjust the MaxIdleTimeMS number as expect. If that is about my mistake, can someone give me some comment pls?
|
| Comments |
| Comment by A B [ 12/Jan/22 ] |
|
@Robert I understand. Thank you very much for your quick confirmation.
|
| Comment by Robert Stam [ 06/Jan/22 ] |
|
I have tried to reproduce what you have reported and all appears to be working properly, but some explanations are in order.
So it could take up to a minute for an idle connection to be removed from the connection pool. However, even though an idle connection might not be removed from the connection pool for up to a minute, an idle connection will never be used by the application. If the application needs a connection from the connection pool only non-idle connections will be returned. |
| Comment by A B [ 06/Jan/22 ] |
|
@Robert I'm using MongoDB.Driver.Core, Version=2.13.2.0. I determine the current number connections by executing db.ServerStatus() command in database console.
|
| Comment by Robert Stam [ 05/Jan/22 ] |
|
In order to investigate your questions please provide the following information:
|