Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Several years ago I built and deployed a system on XP that involved a custom written service that talked to a local 2008 SQL Express instance (that also had a CLR dependency). At the time I set up the custom service to be dependent on the Express service starting up, and all seemed well.

Fast forward to this week where my customer calls me in to debug why things aren't working properly (and apparently hadn't been for a while - a very long story).

What I saw was that when rebooting the machine, 7 out of 10 times everything came up fine. For those 3 out of 10 when it was failing, my custom service was complaining about things like:

  • It couldn't connect to the SQL instance
  • The SQL instance complained that the CLR subsystem wasn't enabled
  • The SQL instance timed out when doing a query

But then when manually restarting my custom service (well after the computer had been rebooted), it came up error free.

So it seems that when XP says that the SQL Express system was up and running, it occasionally wasn't fully up and running, and that there is an unexpected race condition which is killing my assumptions about the XP service dependency order.

So my questions are:

What does it mean when the SQL Express instance announces to the XP service system that it is up and running?

Does it mean all components have been initialized and are ready to work, or is more of a "Hello world" statement?

Finally I also noticed that my client had loaded up the computer with several other pieces of software which probably exposed/caused the race condition that I am seeing. And yes we also started discussing what it would take to move them off XP and onto W7.

share|improve this question
    
You could put your service on Automatic (Delayed Start) which pushes it to after everything else is ready. –  Nathan C Mar 24 at 16:44
    
@NathanC I don't thing that Delayed Start is available on the version of XP being used (or on XP in general) –  Peter M Mar 24 at 17:25
    
Oh right...XP. In this case, you could always make your service also depend on a service that starts up later in bootup (such as the print spooler). –  Nathan C Mar 24 at 18:10

1 Answer 1

One option is to set the recovery options for the service. After it fails have it restart after a short period.

enter image description here

share|improve this answer
    
Neither service is actually crashing. My custom service is happily catching the issues with the SQL Express service and sending them to the Event log. –  Peter M Mar 24 at 19:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.