[SERVER-17295] On Windows, service recovery actions don't work is mongoS fails to initialize Created: 15/Feb/15  Updated: 26/Sep/17  Resolved: 18/Jun/15

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

Type: Bug Priority: Major - P3
Reporter: Alessandro Gherardi Assignee: Mark Benvenuto
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6771 Windows Service: 'net stop mongodb' g... Closed
duplicates SERVER-13338 NT Service does not return failure co... Closed
duplicates SERVER-16085 Windows service: net stop MongoDB giv... Closed
Related
related to SERVER-21019 MongoS service does not restart as pe... Closed
Operating System: Windows
Sprint: Platform 4 06/05/15, Platform 5 06/26/16
Participants:
Case:

 Description   

Environment:

  • Cluster with 1 or more replicasets and 3 config servers, all running on Windows.
  • All MongoDB processes (mongoD, mongoS, config servers) are configured as Windows services. In addition, the services are setup with recovery actions that cause Windows to restart them on failure.
  • mongoS and config servers run on different hosts.

Scenario:

  • Hosts are restarted.
  • mongoS Windows service starts before the config servers Windows services start.
  • mongoS service stops because it can't connect to any config servers.
  • However, Windows does NOT restart it - i.e., the recovery actions don't work.

I believe that the issue is caused by method initService() in ntservice.cpp unconditionally calling reportStatus(SERVICE_STOPPED) when the service callback method returns.

Here's a tentative fix:
https://github.com/mongodb/mongo/pull/925



 Comments   
Comment by Ramon Fernandez Marina [ 29/May/15 ]

agherardi, unfortunately we're not able to accept this pull request as it is, as it's skipping a step in the service stop protocol: the patch skips the final state in the state machine and it has a side effect of convincing Windows we crashed. For more information please see the Remarks section in the documentation for SetServiceStatus at https://msdn.microsoft.com/en-us/library/windows/desktop/ms686241%28v=vs.85%29.aspx

As you probably know this bug has been addressed in the 3.0 version of MongoDB, so if this is still an issue for you you may want to consider upgrading to the latest 3.0 version.

Regards,
Ramón.

Comment by Alessandro Gherardi [ 17/Apr/15 ]

Hello,
Any updates?

Thank you,
Alessandro

Comment by Alessandro Gherardi [ 05/Mar/15 ]

Hello - Any updates?

Thank you,
Alessandro

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