Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65946

Provide better diagnostics for `DBClient::call`

    • Fully Compatible
    • Service Arch 2022-07-11
    • 49

      The current implementation for DBClientConnection::call could absorb exceptions and return a boolean to indicate failures:

      auto maybeThrow = [&](const auto& errStatus) {
          if (assertOk)
              uassertStatusOKWithContext(errStatus, str::stream() << "dbclient error communicating with server " << getServerAddress());
          return false;
      };
      

      This essentially hides the real cause of failure and makes root-causing failures difficult. We should make such failures visible by either:

      • Changing call to always return a Status.
      • Changing call to always throw exceptions.

      Looking at the code, there are not many invocations of call, and we should be able to change the interface to always throw with few changes to the call-sites.

            Assignee:
            jason.chan@mongodb.com Jason Chan
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: