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

Provide better diagnostics for `DBClient::call`

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: