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.