[CSHARP-1811] System.IO.IOException: Unable to read data from the transport connection Created: 25/Oct/16 Updated: 15/Nov/21 Resolved: 27/Oct/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ivan Artemov | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ASP.NET Core (net46) |
||
| Attachments: |
|
| Description |
|
I have MongoCollectionProvider, that registered as Singleton. |
| Comments |
| Comment by Robert Stam [ 27/Oct/16 ] | |
|
Thanks for letting us know. | |
| Comment by Ivan Artemov [ 26/Oct/16 ] | |
|
Thank you, Robert. This is azure connection issue. | |
| Comment by Robert Stam [ 26/Oct/16 ] | |
|
We have heard reports that connections that aren't used for a long time can go bad. Usually it's because there's some router along the way that flushes idle connections. You can try setting maxIdleTime to a lower value (you can do this on the connection string). If you wish to create a single instance of MongoClient and use it repeatedly that's fine. I would actually recommend that as being better than creating a new instance of MongoClient every time you need to do something with the database. | |
| Comment by Ivan Artemov [ 26/Oct/16 ] | |
|
I know about this message, but connection is ok and error appears when application is inactive some minutes and wake up. MongoClient work well when i use it as Singleton ? | |
| Comment by Robert Stam [ 26/Oct/16 ] | |
|
The System.IO.IOException indicates that there is a network problem between the application and the server, as the error message indicates:
I don't understand the second part of your question. MongoClient is not a singleton. |