[CSHARP-2875] Race condition in TcpStreamFactory could result in CreateStream returning a NetworkStream with a closed Socket Created: 13/Dec/19 Updated: 28/Oct/23 Resolved: 13/Jan/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.10.0 |
| Fix Version/s: | 2.10.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
If a timeout or cancellation request happens AFTER `socket.Connect` returns but BEFORE the `connected` variable is set to true the socket could be Closed before the Connect helper method returns: The window for the race condition is VERY small and therefore low probability. |
| Comments |
| Comment by Githook User [ 13/Jan/20 ] | |||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: | |||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 13/Jan/20 ] | |||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: | |||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 13/Dec/19 ] | |||||||||||||||||||||||||||||||||||||||
|
A suggested fix would be:
|