[CSHARP-2621] Connection reset by peer Created: 28/May/19 Updated: 25/Jun/20 Resolved: 25/Jun/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.8.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Riaz Ahmad | Assignee: | Wan Bachtiar |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I am getting a "Connection reset by peer" message periodically throughout the day. I have microservices running .net core 2.1 and .net core 2.2 and both are throwing this exception.
The exception is thrown when doing simple Find queries. I don't have any custom timeout settings applied on MongoClient to setup the connection. I have the connection setup as a singleton to allow MongoClient to grab a connection from the connection pool it manages.
Looking at .net core 2.1 issues, there is a reported defect on this as they have optimized their connection code. I am wondering if the two are related. See Sockets Performance and SocketsHttpHandler https://devblogs.microsoft.com/dotnet/announcing-net-core-2-1-preview-2/ Github Defect https://github.com/dotnet/corefx/issues/32305 I have tried setting DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER environment variable as noted in the above links, but that does not resolve the issue.
Here is the exception details: MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server. ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer at MongoDB.Driver.IAsyncCursorSourceExtensions.ToListAsync[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken) |
| Comments |
| Comment by Rachelle Palmer [ 25/Jun/20 ] |
|
Hi there, thank you for reaching out to MongoDB. As this sounds more like a support issue, I wanted to give you some resources to get this question answered more quickly:
Thank you! |
| Comment by Riaz Ahmad [ 23/Jul/19 ] |
|
This issue looks to be related to |
| Comment by Riaz Ahmad [ 30/May/19 ] |
|
Environment - Ubuntu Bionic 18.04 & Ubuntu Trusty 14.04 |