Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-3245

Avoid hangs on shutdown when a utility thread encounters an error

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.3, 3.5.9, 3.4.14
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Storage 2017-04-17
    • v3.4

      We currently have several different groups of utility threads including:

      • LSM manager threads
      • Eviction worker threads
      • Async API threads
      • Logging threads

      Each group of threads uses a different flag to determine whether the system is running, and the state of those flags is maintained entirely in the subsystem i.e: there is no single place that can shutdown utility threads. That makes sense in an orderly shutdown - since there is a defined order in which shutdown must happen. It leaves us open to cases where server threads exit unexpectedly, their "child" threads may never exit, because the flag they use to continue running is never reset.

      We could make this more robust in several ways including:

      • Add a global flag indicating that all threads should shutdown immediately, which would be enabled after orderly shutdown of subsystems is completed.
      • Switch all usages of thread groups to the thread group code, and ensure consistent and correct handling.
      • Ensure that any time a server thread exits unexpectedly it sets WT_PANIC, and that utility threads check for WT_PANIC regularly.

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: