FIX: A Notification Services application may not deliver all notifications or may deliver notifications with a significant delay (884266)



The information in this article applies to:

  • Microsoft SQL Server 2000 Notification Services 2.0 SP1

Bug#: 296287 (SQL BU Defect Tracking)

SYMPTOMS

When you use a Microsoft SQL Server 2000 Notification Services application to generate and send notifications to delivery services, you may notice that the Notification Services application does not deliver all the notifications or the Notification Services application delivers the notifications with a significant delay.

For example, this problem may occur when you configure lots of delivery channels and you use only some of the delivery channels to send notifications.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next SQL Server 2000 Notification Services service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Date         Time   Version     Size       File name
----------------------------------------------------------------
30-Jun-2004  16:33  2.0.3008.2  2,101,248  Microsoft.sqlserver.notificationservices.dll
30-Jun-2004  16:33  2.0.3008.2     36,864  Nscontrol.exe

WORKAROUND

To work around this problem, follow these steps:
  1. Stop your event provider, the Notification Services generator service, and all the Notification Services distributor services on all your computers.
  2. Mark the unprocessed work items that are associated with the delivery channels that you want to remove as expired. After you do this, the distributor does not try to process the work items after the delivery channels are removed. To do this, run the following Transact-SQL command in SQL Query Analyzer against your Notification Services application database:
    UPDATE NSDistributorWorkItems 
    SET DistributorWorkItemStatusCode = 5  --Expired
    WHERE DistributorWorkItemStatusCode = 0 --Distribution never attempted
        AND AssignmentStatusCode = 0    --Unassigned
        AND DeliveryChannelName NOT IN (ListOfUsedDeliveryChannelNames)
    

    Note ListOfUsedDeliveryChannelNames is a placeholder for the list of used delivery channels, separated by commas. For example, N'DeliveryChannelName1', N'DeliveryChannelName2', N'DeliveryChannelName3'
  3. To improve performance, create an additional index on the NSDistributorWorkItems table in the Notification Services application database. To do this, run the following Transact-SQL statement in SQL Query Analyzer:
    CREATE INDEX NSDistributorWorkItemsASCDWISCNextRetryTimeIndex 
    ON NSDistributorWorkItems(AssignmentStatusCode, DistributorWorkItemStatusCode, NextRetryTime)
    
  4. Start the Notification Services distributor services on all the computers.
  5. Start the Notification Services generator.
  6. Start the event providers.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Notification Services generates notifications in batches. Based on the delivery channel that each notification targets, the distributor components in a Notification Services application break the batches into smaller units that are referred to as work items. To perform delivery operations, each distributor can process multiple work items in parallel by using worker threads. When the processing of one work item is completed, a scheduling algorithm looks for additional work items that the distributor can process by using the worker thread that becomes free. However, when the distributor finishes processing a work item, the distributor may pick up additional work items that use additional work threads even when the thread count limit that you specified has been reached.

You notice this problem in a scenario when you configure a lot of delivery channels and use only some of the delivery channels to send notifications. When you have lots of delivery channels that are not used, many work items are created that are empty. Because the work items are empty, the time that is taken to process these work items is the same and the distributor finishes processing more than one work item at the same time. This causes more than one thread to be scheduled at the same time. Therefore, you notice the behavior that is mentioned in the "Symptoms" section.

After you apply the hotfix

To improve performance after you apply the hotfix, create an index on the NSDistributorWorkItems table that is specified in step 3 of the "Workaround" section. The hotfix does not create this index. You must manually create this index in your Notification Services application database.

REFERENCES

For more information, see the following topics in the SQL Server Notification Services Books Online: For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Modification Type:MinorLast Reviewed:10/7/2005
Keywords:kbDatabase kbThread kbBug kbfix kbQFE KB884266 kbAudDeveloper