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

Graceful shutdown without destroying the current cmd

    • Repl 2020-07-27

      This feature would provide the option to request a graceful shutdown of mongos. Its behavior is outlined below:

      1. the client sends a request to a mongos that forwards the query to mongodb
      2. when mongos receives a specific signal (like SIGTERM), all heartbeats return an error to the client
      3. the client removes that mongos from the available mongos pool and does not send any new requests to that mongos
      4. mongos waits until all old queries are done without accepting new ones
      5. mongos now is free to shut down itself
        In the fourth item, mongos could wait endlessly, so a timer can force the shutdown aggressively to avoid stall state.
      Original Description

      Is it possible to shutdown mongos daemon gracefully? Which signal I should launch to the process?

      Thinking about a mongos that has received a query. While the mongodb calculates the query, the mongos can be stopped. If mongos is stopped, the client driver (like nodejs does) returns a socket error.
      This mean that the client is not able to know if the query runs successfully or not.
      In a write context is a problem. A socket error is undetermined state.

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            tomallevi@gmail.com Tommaso Allevi
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: