Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1173

Add connected status to connection to avoid race conditions

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • None

    Description

      If Disconnect is called without a deadline while a connection is still checked out, we will aggressively close connections, which involves setting the underlying net.Conn to nil. This can cause a race condition if the checked out connection is in the middle of a network read.

      We can fix this by adding a atomic int32 status to the connection type to test if a connection is open/closed instead of checking if c.nc == nil.

      Attachments

        Activity

          People

            divjot.arora@mongodb.com Divjot Arora
            divjot.arora@mongodb.com Divjot Arora
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: