S h o r t S t o r i e s

// Tales from software development

The generator failed while calculating the amount of time to sleep until the next quantum ends

with one comment

I’m writing an interface for an application that needs to work with a clinical health system that uses Microsoft SQL Server Notification Services. A few weeks ago I started up the virtual machine that has a copy of the clinical health system installed on it and noticed that one of its services had failed to start. Repeated attempts to start it failed and when I looked in the event log I saw this cryptic error message from SQL Server Notification Services:

The generator failed while calculating the amount of time to sleep until the next quantum ends.

For once, Google didn’t provide any useful links that might shed some light on the problem or explain how to resolve it. Fortunately, the technical guys at the company that develops the clinical health system had seen the problem previously and were able to tell me how to resolve it.

The problem arises when Notification Services hasn’t been running for more than 20 days and 20 hours because the calculation it uses to determine how long it is since it was last ran overflows when the elapsed time is greater than this. Seems like Microsoft didn’t test this bit of Notification Services very rigorously.

The solution to get Notification Services started again is:

  • Ensure that all Notification Services applications (usually services) are stopped.
  • Run the NSSetQuantumClockDate stored procedure in each database that uses Notification Services specifying the date and time from which notifications should be processed.
  • Restart the Notifications Services applications.
  • Check that the services all restarted successfully and check the event log to confirm that the problem has been resolved.

Written by Sea Monkey

October 5, 2009 at 7:00 pm

One Response

Subscribe to comments with RSS.

  1. It’s been a while but I had to do this again today so here’s a few extra details:

    1. The notification service that needs to be stopped and disabled appears under the Notification Services item in SQL Server Management Studio. Right-click it and select ‘Stop’, then right-click it again and select ‘Disable’.

    2. The syntax for calling the NSSetQuantumClockDate stored procedure is: “execute dbo.NSSetQuantumClockDate ‘2013-10-17 16:00:00’;”

    3. After running the stored procedure in each database that uses Notification Services, re-enable the notification service that was stopped and disabled in step 1 and then start it again.

    Sea Monkey

    October 17, 2013 at 5:27 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: