[SERVER-3582] Mongo Windows Service locks up CPU when computer reboots after a crash. Created: 11/Aug/11  Updated: 11/Jul/16  Resolved: 26/Nov/11

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 1.8.2
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Ian Campbell Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: crash, logging
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64 bit, Mongo 64 bit


Attachments: File log     File mongod.lock    
Issue Links:
Duplicate
is duplicated by SERVER-3942 MongoDB service on Windows infinitely... Closed
Related
is related to SERVER-4373 Windows service should "do the right ... Closed
Operating System: Windows
Participants:

 Description   

I have MongoDB set up as a Windows Service. If Windows crashes, MongoDB has a lock file in the data directory that causes the server to use 100% CPU and write continuously to the log file. This happens even if Mongo was never used. Currently the only solution is to disable the service and delete the lock file.



 Comments   
Comment by Tad Marshall [ 26/Nov/11 ]

I posted bug SERVER-4373 – Windows service should "do the right thing" after a crash – to address the need to recover better after a system crash.

Comment by Tad Marshall [ 26/Nov/11 ]

Fixed by commit 03cfbb50629b32c58db1cfef7e9e08e30d0c9fe6 .
We were setting the MongoDB Windows service to auto-restart, but this is doomed to failure after a crash because the mongod.lock file will cause us to fail on restart, leading to an endless loop.
We need to have a better solution to this, so that we restart in recovery mode or notify an administrator of the need for manual intervention somehow. I'll post a separate bug asking for that.

Comment by auto [ 26/Nov/11 ]

Author:

{u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-3582 – Mongo Windows Service locks up CPU when computer reboots after a crash

Remove (put on the wrong side of #if 1, actually) the code that was setting
up automatic restarts (forever) after a "failure". Anything other than a
clean exit would cause automatic restart, and anything other than a clean
exit would leave the mongod.lock file set, which would cause another failure.
We need to have a better scheme for having the Windows service "do the right
thing" after a power failure or system crash, looping forever in failure mode
is not good behavior.
Branch: master
https://github.com/mongodb/mongo/commit/03cfbb50629b32c58db1cfef7e9e08e30d0c9fe6

Comment by Ian Campbell [ 18/Aug/11 ]

The tail end of the log file + the lock file. You can see the server infinitely keeps restarting.

Comment by Chris Westin [ 12/Aug/11 ]

Do you still have the log file? It might be helpful to see what mongod is writing, even just the tail end of it, if you have it. If you do, please attach it here.

Generated at Thu Feb 08 03:03:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.