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

Add connected status to connection to avoid race conditions

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: