Race condition in TcpStreamFactory could result in CreateStream returning a NetworkStream with a closed Socket

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.10.1
    • Affects Version/s: 2.10.0
    • Component/s: Connectivity
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:

      https://github.com/mongodb/mongo-csharp-driver/blob/v2.10.0/src/MongoDB.Driver.Core/Core/Connections/TcpStreamFactory.cs#L144

      The window for the race condition is VERY small and therefore low probability.

            Assignee:
            Robert Stam
            Reporter:
            Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: