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.