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

Avoid special-case handling in ServiceEntryPointImpl::shutdown

    • Service Arch
    • ALL
    • Service Arch 2022-1-10
    • 0

      Shutting down the service entry point outside TSAN and ASAN builds immediately returns true without running any shutdown code. A separate interface, shutdownAndWait, is introduced to shutdown the service entry point.

      bool ServiceEntryPointImpl::shutdown(Milliseconds timeout) {
      #if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer)
          // When running under address sanitizer, we get false positive leaks due to disorder around
          // the lifecycle of a connection and request. When we are running under ASAN, we try a lot
          // harder to dry up the server from active connections before going on to really shut down.
          return shutdownAndWait(timeout);
      #else
          return true;
      #endif
      }
      

      We should remove the special-case handling in shutdown and have it run the body of shutdownAndWait. This would also obviate the need for shutdownAndWait.

      Acceptance criteria: Change the code to have #if at the higher level of the stack. Make sure we link these to the relevant shutdown project. 

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

              Created:
              Updated:
              Resolved: