CommandHelpers::runCommandInvocation and similar functions should not grab a shared_ptr to CommandInvocationHooks

XMLWordPrintableJSON

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

       This was discovered while investigating BF-24415

      In commands.cpp, CommandHelpers::runCommandInvocation, we do:

      auto hooks = getCommandInvocationHooksHandle(opCtx->getServiceContext());
      

      Given that the ServiceContext keeps keeps the CommandInvocationHooks alive, there is no need for hooks to be a shared_ptr. getCommandInvocationHooksHandle should not cause us to Incref and Decref. 

      We don't expect for this to address the root cause of BF-BF-24415, but we do expect it to manifest more clearly if we introduce this change.

            Assignee:
            Matt Diener (Inactive)
            Reporter:
            Matt Diener (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: