mongod --shutdown exits with code 100 and doesn't shutdown running mongod

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • Fully Compatible
    • ALL
    • Programmability 2026-02-02
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      On 8.2, if you do the following:

      mongod --dbpath /tmp/dbpath/ --logpath /dev/null --fork
      mongod --dbpath /tmp/dbpath/ --shutdown
      

      The second command successfully kills mongod. On master, if I do the same thing, the second command exits because it fails to get a lock on the dbpath:

      ...snip...
      {"t":{"$date":"2026-02-19T15:40:52.162+00:00"},"s":"E",  "c":"CONTROL",  "id":20557,   "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"DBPathInUse: Unable to lock the lock file: /tmp/dbpath/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /tmp/dbpath directory"}}
      ...snip...
      

            Assignee:
            Ryan Berryhill
            Reporter:
            Ryan Berryhill
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: