Microsoft Knowledge Base Email Alertz

FIX: Error message in the SQL Server 2005 Errorlog file after the SQL Server service stops responding: “Timeout occurred while waiting for latch”

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 974205 - Last Review: November 2, 2009 - Revision: 2.1

FIX: Error message in the Errorlog file of SQL Server 2005 or of SQL Server 2008 after the SQL Server service stops responding: "Timeout occurred while waiting for latch"

Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.Microsoft distributes Microsoft SQL Server 2008 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release.

On This Page

SYMPTOMS

In Microsoft SQL Server 2005, you may encounter one of the following problems.

Problem 1

The SQL Server service stops responding, and a memory dump file is generated in the SQL Server 2005 log folder. Additionally, the following error message is logged in the SQL Server 2005 Errorlog file:

Date Time SPID Timeout occurred while waiting for latch: class 'QUERY_OPTIMIZER_ID_MANAGER', id 000000008031A7E0, type 4, Task 0x0000000000DAFAC8 : 0, waittime 300, flags 0x1a, owning task 0x0000000005454718. Continuing to wait.
Date Time SPID Timeout occurred while waiting for latch: class 'QUERY_OPTIMIZER_ID_MANAGER', id 000000008031A7E0, type 4, Task 0x000000000771A328 : 0, waittime 300, flags 0x1a, owning task 0x0000000005454718. Continuing to wait.
Date Time SPID Using 'dbghelp.dll' version '4.0.5'
Date Time SPID **Dump thread - spid = 148, PSS = 0x0000000126F4FBF0, EC = 0x0000000126F4FC00
Date Time SPID ***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump0021.txt
Date Time SPID * *******************************************************************************
Date Time SPID *
Date Time SPID * BEGIN STACK DUMP:
Date Time SPID * Date Time SPID
Date Time SPID *
Date Time SPID * Latch timeout
Date Time SPID *
Date Time SPID * Input Buffer 168 bytes -
Date Time SPID * SELECT backup_set_id FROM msdb..backupset WITH (NOLOCK) WHERE media_set_
Date Time SPID * id = 226059
Date Time SPID *
Date Time SPID * *******************************************************************************
Date Time SPID * -------------------------------------------------------------------------------
Date Time SPID * Short Stack Dump
Date Time SPID Stack Signature for the dump is 0x00000001212FF0DE
Date Time SPID Timeout occurred while waiting for latch: class 'QUERY_OPTIMIZER_ID_MANAGER', id 000000008031A7E0, type 4, Task 0x0000000007F31D68 : 0, waittime 300, flags 0x1a, owning task 0x0000000005454718. Continuing to wait.


When this problem occurs, the server does not respond to any attempted operations. The only way to make SQL Server functional again is to restart the SQL Server service.
Note Any system or user-level query can encounter this issue.

Problem 2

When the query optimizer of SQL Server 2005 generates a query plan, the query optimizer may wait for a spinlock to be released. The spinlock is used to access internal structure to record information about the missing indexes for the query plan. While the query optimizer is waiting for the spinlock, the query optimizer does not release the scheduler.In rare conditions the query optimizer does not obtain the spinlock and keeps holding the scheduler. This causes a "non-yielding scheduler" error and some other errors to be logged in the SQL Server Errorlog file. Additionally, SQL Server creates a memory dump in the SQL Server log folder. The memory dump records the context of the problem that the query optimizer does not release the scheduler.

If the query optimizer optimizes multiple queries on multiple schedulers, this problem may generate one or more "non-yielding scheduler" errors in the SQL Server Errorlog file.

The following are the sample errors that are logged in the SQL Server Errorlog file when this problem occurs.

Note There is more than one cause of the "non-yielding schedulers" error. You must analyze the memory dump to determine whether the context of "non-yielding scheduler" error matches the problem context that is described in this article.

Error 1

**Dump thread - spid = 0, PSS = 0x0000000000000000, EC = 0x0000000000000000
***Stack Dump being sent to D:\Microsoft Sql Server\MSSQL.1\MSSQL\LOG\SQLDump0001.txt
* *******************************************************************************
*
* BEGIN STACK DUMP:
*   10/22/09 11:01:13 spid 0
*
* Deadlocked Schedulers
*
* *******************************************************************************
* -------------------------------------------------------------------------------
* Short Stack Dump
Stack Signature for the dump is 0x00000000000000D7
External dump process return code 0x20000001.

Error 2

* *******************************************************************************
*
* BEGIN STACK DUMP:
*   10/22/09 11:01:23 spid 0
*
* Non-yielding Scheduler
*
* *******************************************************************************
Stack Signature for the dump is 0x00000000000000D7

Error 3

<Date><Time> Server      New queries assigned to process on Node 0 have not been picked  up by a worker thread in the last 60 seconds. Blocking or long-running queries can contribute to this condition, and may degrade client response time.  Use the "max worker threads" configuration option to increase number  of allowable threads, or optimize current running queries.  SQL Process Utilization: 0%. System Idle: 99%.

Error 4

Note The Process ID, the Worker ID, the Scheduler ID and the time may change for your scenario.
Process 103:0:0 (0x4e0) Worker 0x0000000090A1A1C0 appears to be non-yielding on Scheduler 1. Thread creation time: 12900592800518. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 0%. System Idle 98%. Interval: 74595 ms.
Process 101:0:0 (0x15f0) Worker 0x00000000908A01C0 appears to be non-yielding on Scheduler 2. Thread creation time: 12900652201513. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 0%. System Idle 98%. Interval: 76376 ms.
Process 61:0:0 (0x144) Worker 0x00000000FB4141C0 appears to be non-yielding on Scheduler 0. Thread creation time: 12900697200999. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 0%. System Idle 98%. Interval: 76376 ms.
Process 67:0:0 (0x1778) Worker 0x00000000902081C0 appears to be non-yielding on Scheduler 3. Thread creation time: 12900129835565. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 0%. System Idle 98%. Interval: 76376 ms.

CAUSE

This issue occurs when SQL Server processes missing index information for a dynamic management view (DMV). No user intervention is required to cause this issue. This issue is a rare, timing-related issue.

RESOLUTION

SQL Server 2005 Service Pack 3

The fix for this issue was first released in Cumulative Update 6 for SQL Server 2005 Service Pack 3. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
974648  (http://kbalertz.com/Feedback.aspx?kbNumber=974648/ ) Cumulative update package 6 for SQL Server 2005 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
960598  (http://kbalertz.com/Feedback.aspx?kbNumber=960598/ ) The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 3 was released
Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 3 hotfix to an installation of SQL Server 2005 Service Pack 3. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

The release version of SQL Server 2008

Important You must install this fix if you are running the release version of SQL Server 2008.

The fix for this issue was first released in Cumulative Update 8. For more information about how to obtain this cumulative update package for SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
975976  (http://kbalertz.com/Feedback.aspx?kbNumber=975976/ ) Cumulative update package 8 for SQL Server 2008
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
956909  (http://kbalertz.com/Feedback.aspx?kbNumber=956909/ ) The SQL Server 2008 builds that were released after SQL Server 2008 was released

SQL Server 2008 Service Pack 1

Important You must install this fix if you are running SQL Server 2008 Service Pack 1.

The fix for this issue was first released in Cumulative Update 5 for SQL Server 2008 Service Pack 1. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
975977  (http://kbalertz.com/Feedback.aspx?kbNumber=975977/ ) Cumulative update package 5 for SQL Server 2008 Service Pack 1
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
970365  (http://kbalertz.com/Feedback.aspx?kbNumber=970365/ ) The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 1 was released
Microsoft SQL Server 2008 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2008 Service Pack 1 hotfix to an installation of SQL Server 2008 Service Pack 1. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

STATUS

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

REFERENCES

For more informationabout the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897  (http://kbalertz.com/Feedback.aspx?kbNumber=935897/ ) An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more informationabout how to obtain SQL Server 2005 Service Pack 3, click the following article number to view the article in the Microsoft Knowledge Base:
913089  (http://kbalertz.com/Feedback.aspx?kbNumber=913089/ ) How to obtain the latest service pack for SQL Server 2005
For more information about the new features in SQL Server 2005 Service Pack 3 (SP3) and about the improvements in SQL Server 2005 SP3, visit the following Microsoft Web site:
http://go.microsoft.com/fwlink/?LinkId=131442 (http://go.microsoft.com/fwlink/?LinkId=131442)
For more informationabout the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499  (http://kbalertz.com/Feedback.aspx?kbNumber=822499/ ) New naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://kbalertz.com/Feedback.aspx?kbNumber=824684/ ) Description of the standard terminology that is used to describe Microsoft software updates

APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Web
  • Microsoft SQL Server 2008 Workgroup
Keywords: 
kbsurveynew kbfix kbqfe kbexpertiseadvanced KB974205
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate