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

Create a server parameter for ServiceEntryPointImpl::shutdownAndWait

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Service Arch 2022-03-07
    • 2

      ServiceEntryPointImpl::shutdownAndWait is currently held behind a compilation flag and is only called when the code is instrumented with either thread or address sanitizers. A lot of code has been written taking this ill formed behavior into consideration which now makes it trickier to get it fixed - by removing the compilation flag few dozen of tests start failing. Also, the team isn't confident about the overall impact it would have on a production environment.

      While consulting with other peers from the Service Arch team, a good approach towards solving it is running ServiceEntryPointImpl::shutdownAndWait conditioned to a server parameter. This way, builds can be triggered as needed and BFs opened accordingly.

      The overarching goal is to eventually turn the flag on by default.

       bool ServiceEntryPointImpl::shutdown(Milliseconds timeout) {
      +    bool shouldShutdownAndWait = feature_flags::gFeatureFlagShutdownAndWait.isEnabledAndIgnoreFCV();
      +
       #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;
      +    shouldShutdownAndWait = true;
       #endif
      +
      +    if (shouldShutdownAndWait)
      +        return shutdownAndWait(timeout);
      +    else
      +        return true;
       }
      
      

            Assignee:
            daniel.morilha@mongodb.com Daniel Morilha (Inactive)
            Reporter:
            daniel.morilha@mongodb.com Daniel Morilha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: