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

Context pinned by connection.connect

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The connection.connect function wraps the supplied context using context.WithCancel and stores the returned cancellation function so we can abort connection establishment. We need to ensure we call that function in a defer after connect finishes and also set it to nil because the cancellation function holds a reference to the context, which pins all of the memory that the context has stored.

      This will require a mutex for syncrhonization because the cancellation function is accessed by both the connect and closeConnectContext functions.

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

              Created:
              Updated:
              Resolved: