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

Returning ErrClientDisconnected when sessionPool is null is unecessary

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Detailed steps to reproduce the problem?

      We can rely on the Topology being disconnected to return ErrClientDisconnected, rather than checking sessionPool is nullfied. This is legacy code to prevent calls from panicking when using NewClient, which has been removed in 2.0.

      This is a breaking change since it will change the behavior of StartSession, which will no longer return ErrClientDisconnected when called after the client has been disconnected.

      Definition of done: what must be done to consider the task complete?

      Remove all sessionPool == nil behavior from mongo/client.go. This will require updating this line to use `Connect` instead of newClient. It will also require removing various tests that expect the ErrClientDisconnected error

            Assignee:
            joy.wang@mongodb.com Joy Wang
            Reporter:
            preston.vasquez@mongodb.com Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: