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

Add connected status to connection to avoid race conditions

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: None
    • Labels:
      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

            Assignee:
            divjot.arora Divjot Arora
            Reporter:
            divjot.arora Divjot Arora
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: