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

Introduce onStepDown cancelation token to fix shutdown memory leak

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • 0

      The motivation for this is to make a clean refactoring of the executor usage for BF-18913 and SERVER-51317. We do not cancel pending tasks in the transaction coordinator and they show up as memory leak.

      Switching the transaction coordinator to use AsyncWorkScheduler for all tasks is not possible because it can block for a while. Right now we rely on the fact that Grid pool executor is not shutting down as explained in SERVER-51316.

      We cannot use any global flag like globalInShutdownDeprecated() because it breaks the termination sequence.

      Proposed solution:

      Add one or several cancelation tokens specifically for onStepDown to be used in src/mongo/db/commands/shutdown_d.cpp and cancel them in proper order from stepDownForShutdown() and beginShutdown().

      When the foundation is in I will wire the proper token to be used in the transaction coordinator as part of working on SERVER-51317.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: