Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-534

MongoServerInstance.AcquireConnection throws InvalidOperationException

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.5
    • Component/s: None
    • Minor Change

      When server instance gets disconnected and state verification have not yet kicked in, MongoServerInstance.AcquireConnection throws InvalidOperationException("Server instance XXX is no longer connected."). While this is an internal state problem (so IOE fits the scheme), I think it should be treated as a transient connection error and instead throw a MongoConnectionException (with the same message). For us, the exception types are really important, because we've built an auto-retry mechanism around driver calls, and catching something as ambiguous as InvalidOperationException makes robust error handling hard enough.

            Assignee:
            Unassigned Unassigned
            Reporter:
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: