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

AsioReactor doesn't drain all work

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • Fully Compatible
    • ALL
    • v8.0, v7.3
    • Service Arch 2024-04-01, Service Arch 2024-04-15
    • 153

      AsioReactor uses the asio::io_context::poll method in AsioReactor::drain to flush remaining work during shutdown. The poll method only acts on immediately ready handlers, which means that drain can return while handlers that aren't immediately ready remain in the queue. Change the drain method to use the asio::io_context::run method instead, so that all work is drained.

      Note that the AsioReactor::run method creates an asio::io_context::work object before invoking asio::io_context::run. The effect of the work object is to change the behavior of run so that it blocks even when the handler queue is empty. Without the object, run will return as soon as all outstanding handlers are resolved.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            james.bronsted@mongodb.com James Bronsted
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: