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

mongod.exe does not shut down correctly as a Windows service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 2.0.7, 2.1.0
    • Component/s: Usability
    • Labels:
      None
    • Environment:
      Windows 7 64-bit
    • Operating System:
      Windows

      Description

      Rewritten description: When a MongoDB server is stopped by the Windows Service Control Manager (with "net stop mongodb" or during system shutdown or restart), mongo wasn't notifying the Service Control Manager of its steps to shutdown and was ignoring a direct shutdown notification, leading to an unclean shutdown.

      Original description: I've created a service on my pc to start mongod on every start-up of the system.
      When I try to connect to mongo from commandline by using the mongo command the result is the following error:
      Error: couldn't connect to server 127.0.0.1 shell/mongo.js:79 exception: connect failed

      We figured out that the problem is that mongod didn't start properly. When I have a look at the service list the status is always "starting" and didn't change. The service isn't able to start up properly.

      When I go to the data folder where all my db data are stored and remove the mongod.lock file. The service is able to start and I can connect to mongoDB.
      The pid which is inside the mongod.lock file isn't available when I have a look at the tast manager.

      When I reboot my pc the problem is going to occur again. Removing the mongod.lock file resolves the problem.

      Therefore I guess there is a problem that the service didn't shutdown and remove the mongod.lock file when you shutdown your pc.

      We were able to reproduce the problem on different computers.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: