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

Improve exception handling in ASIOSession::end()

    XMLWordPrintable

Details

    • Improvement
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • Internal Code

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-servicearch Backlog - Service Architecture
              amirsaman.memaripour@mongodb.com Amirsaman Memaripour
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: