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

Improve exception handling in ASIOSession::end()

    • Service Arch

      Any exception thrown while ending an ASIO session is currently absorbed by a log statement and never returned to the caller:

      void end() override {
          if (getSocket().is_open()) {
              std::error_code ec;
              getSocket().shutdown(GenericSocket::shutdown_both, ec);
              if ((ec) && (ec != asio::error::not_connected)) {
                  LOGV2_ERROR(23841, "Error shutting down socket: {error}", "Error shutting down socket", "error"_attr = ec.message());
              }
          }
      }
      

      We should investigate alternatives to improve handling of exceptions.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: