[CSHARP-2011] ObjectDisposedException on new connection Created: 05/Jul/17 Updated: 31/Mar/22 |
|
| Status: | Backlog |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.4.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aristarkh Zagorodnikov | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
.NET Core 2.0.0-preview2 |
||
| Issue Links: |
|
||||||||
| Description |
|
Occasinally when querying the database, we get the following exception:
The strange part about this is that according to a stack trace it should be a newly created socket. This also might be a bug in .NET Core 2.0-preview2 (especially since it's a preview), but I don't think so, the other network-related code in the application functions normally (though it doesn't rule this out completely). |
| Comments |
| Comment by Oleg Temnov [ 20/Feb/18 ] | |||||||||
| Comment by Oleg Temnov [ 19/Feb/18 ] | |||||||||
|
I get this exception several times per day, connecting from Azure to Amazon | |||||||||
| Comment by Robert Stam [ 11/Jan/18 ] | |||||||||
|
Looking at the Connect method in TcpStreamFactory: There would appear to be some race conditions that would allow the method to return without throwing an exception and yet the socket could be Disposed. That could explain the ObjectDisposedException shortly thereafter. | |||||||||
| Comment by Aristarkh Zagorodnikov [ 05/Jul/17 ] | |||||||||
|
Connection string: mongodb://127.0.0.1/a?uuidRepresentation=Standard;maxPoolSize=300;socketTimeout=00:00:06;connectTimeout=00:00:01.500;serverSelectionTimeout=00:00:03
The cancellationToken is a Kestrel RequestAborted one. | |||||||||
| Comment by Craig Wilson [ 05/Jul/17 ] | |||||||||
|
Thanks Aristarkh, Yeah, this is a bit weird, since the stack trace shows a brand new socket. 1. What are you doing? Just a normal query? Craig |