[SERVER-3942] MongoDB service on Windows infinitely restarts when server goes down abnormally Created: 24/Sep/11  Updated: 01/Oct/12  Resolved: 05/Dec/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aristarkh Zagorodnikov Assignee: Tad Marshall
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Server 2003R2 32-bit


Attachments: File mongodb.reg    
Issue Links:
Duplicate
duplicates SERVER-3582 Mongo Windows Service locks up CPU wh... Closed
Related
is related to SERVER-4373 Windows service should "do the right ... Closed
Operating System: Windows
Participants:

 Description   

This is a Windows-specific problem. After hard crash (actually I intentionally pulled the power plug on the test machine), MongoDB service got stuck in the "Starting" phase infinitely trying to start complaining about "old lock" (yes, the journalling is also turned off). I suggest there should be either a limit for autorestarts (I ended up with several gigabytes worth of logfiles filled with "start, oh-there's-an-old-lock-file, stop") on such failures or no autorestarts at all, at least for problems that aren't going to solve themselves. The existing SysV init.d script behavior looks fine to me, autorestarting on failing to obtain a lock or bind to an interface doesn't look to improve robustness under Windows, especially getting out of the "Starting" state ain't that easy.



 Comments   
Comment by Tad Marshall [ 05/Dec/11 ]

This is a duplicate of SERVER-3582 and is fixed for 2.1.0 by no longer setting up automatic restarts on a failing mongod.exe Windows service. There is also a new ticket, SERVER-4373, to try to bring back automatic restart in such a way that it won't fail again, but that bug is still open.

Comment by Spencer Brody (Inactive) [ 05/Dec/11 ]

I have successfully reproduced the issue with MongoDB 2.0.1 on Windows 7.

Comment by Aristarkh Zagorodnikov [ 25/Sep/11 ]

"ImagePath" key is removed due to security reasons

Comment by Aristarkh Zagorodnikov [ 25/Sep/11 ]

I am the administrator of the server and I did not do any customizations to the service installation process. I installed it to my development notebook and recovery policy is the same – restart on first, second and subsequent failures with zero interval. SCM just follows the policy and infinitely restarts the service. I'll attach the registry settings.

Comment by Scott Hernandez (Inactive) [ 24/Sep/11 ]

The mongod service installer does not set any rules when the service processes stops (like restarting the service). If this happened it was from settings manually made by your administrators. https://github.com/mongodb/mongo/blob/master/util/ntservice.cpp#L228

Can you export your registry settings for the service so we can see what is there? Also, exporting your event log entries will help as well to see what the SCM was doing which caused an infinite loop.

Comment by Aristarkh Zagorodnikov [ 24/Sep/11 ]

I forgot to add that I understand that it's the SCM is the one which restarts the service, but it's the service installer that configures the crash recovery settings for the service.

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