FIX: "Non-yielding Scheduler" error may occur when you use the CONTAINSTABLE function together with many OR and AND predicates in SQL Server 2008 or in SQL Server 2008 R2

Article translations Article translations
Article ID: 2344600 - View products that this article applies to.
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.Microsoft distributes Microsoft SQL Server 2008 or SQL Server 2008 R2 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 or SQL Server 2008 R2 fix release.
Expand all | Collapse all

On This Page

SYMPTOMS

Consider the following scenario:
  • You have a full-text search query that uses the CONTAINSTABLE function together with many OR and AND predicates in the condition in Microsoft SQL Server 2008 or in SQL Server 2008 R2. For example, you have the following 50 AND operations:
    Declare @Keywords varchar(4000) = NULL
    
    set @Keywords= N'((((((((((((((((((((((((((((((((((((((((((((((((((((
    ("TOKarchitect" OR "architectural") 
    AND ("TOKengineer" OR "engineer")) 
    AND "gineer") AND ("TOKmechanical" OR "Mechanical")) 
    AND ("TOKengineer" OR "Engineering")) 
    AND ("TOKelectronic" OR "Electronics")) AND ("TOKengineer" OR "Engineer")) AND ("TOKelectronic" OR "Electronics")) AND ("TOKengineer" OR "Engineering")) AND ("TOKelectric" OR "Electrical")) AND ("TOKengineer" OR "Engineer")) AND ("TOKelectric" OR "Electrical")) AND ("TOKengineer" OR "Engineering")) AND ("TOKcontrol" OR "Control")) AND ("TOKsystem" OR "Systems")) AND ("TOKengineer" OR "Engineer")) AND ("TOKproject" OR "Project")) AND ("TOKmanager" OR "Manager")) AND ("TOKengineer" OR "Engineering")) AND "Scheme") AND ("TOKmanufacture" OR "Manufacturing")) AND ("TOKengineer" OR "Engineer")) AND ("TOKmetallurgist" OR "Metallurgy")) AND ("TOKmetallurgist" OR "Metallurgist")) AND ("TOKprocess" OR "Process")) AND ("TOKTechnology" OR "Technology")) AND ("TOKproduct" OR "Production")) AND ("TOKengineer" OR "Engineer")) AND ("TOKQuality" OR "Quality")) AND ("TOKengineer" OR "Engineer")) AND ("TOKQuality" OR "Quality")) AND ("TOKcontrol" OR "Control")) AND ("TOKengineer" OR "Engineer")) AND "Mechatronics") AND ("TOKcivil" OR "Civil")) AND ("TOKengineer" OR "Engineer")) AND ("TOKcivil" OR "Civil")) AND ("TOKengineer" OR "Engineering")) AND ("TOKdesign" OR "Design")) AND ("TOKengineer" OR "Engineering")) AND ("TOKdesign" OR "Design")) AND ("TOKengineer" OR "Engineer")) AND ("TOKgraduate" OR "Graduate")) AND ("TOKengineer" OR "Engineer")) AND ("TOKgraduate" OR "Graduate")) AND ("TOKengineer" OR "engineering")) AND ("TOKengineer" OR "Engineering")) AND ("TOKgraduate" OR "Graduate")) AND ") ANDNOT (") AND ("TOKRecruitment" OR "Recruitment")) AND ("TOKconsultant" OR "consultant")) AND ("TOKtrainee" OR "trainee")) AND ("TOKRecruitment" OR "recruitment"))'
    
    select * from CONTAINSTABLE(test_table, *, @keywords, 1000) 
  • You run the query.
In this scenario, a "Non-yielding Scheduler" error may occur. Additionally, a mini-dump file is generated in the SQL Server 2008 or SQL Server 2008 R2 Application log folder, and the following error is logged in the SQL Server Error log file:
<Time Stamp> Server Using 'dbghelp.dll' version '4.0.5'
<Time Stamp> Server ***Unable to get thread context for spid 0
<Time Stamp> Server *
*******************************************************************************
<Time Stamp> Server *
<Time Stamp> Server * BEGIN STACK DUMP:
<Time Stamp> Server * <Time> spid <SPID>
<Time Stamp> Server *
<Time Stamp> Server * Non-yielding Scheduler
<Time Stamp> Server *
<Time Stamp> Server *
*******************************************************************************
<Time Stamp> Server Stack Signature for the dump is 0x000000000000030D
<Time Stamp> Server External dump process return code 0x20000001. External dump process returned no errors.
<Time Stamp> Server Process 0:0:0 (0xf94) Worker 0x00000000817481A0 appears to be non-yielding on Scheduler 0. Thread creation time: 12925321224306. Approx Thread CPU Used: kernel 62 ms, user 75187 ms. Process Utilization 98%. System Idle 0%. Interval: 76403 ms.
<Time Stamp> Server Process 0:0:0 (0xf94) Worker 0x00000000817481A0 appears to be non-yielding on Scheduler 0. Thread creation time: 12925321224306. Approx Thread CPU Used: kernel 125 ms, user 145250 ms. Process Utilization 98%. System Idle 0%. Interval: 148417 ms.
<Time Stamp> Server Process 0:0:0 (0xf94) Worker 0x00000000817481A0 appears to be non-yielding on Scheduler 0. Thread creation time: 12925321224306. Approx Thread CPU Used: kernel 171 ms, user 205515 ms. Process Utilization 98%. System Idle 0%. Interval: 209729 ms.
<Time Stamp> Server Process 0:0:0 (0xf94) Worker 0x00000000817481A0 appears to be non-yielding on Scheduler 0. Thread creation time: 12925321224306. Approx Thread CPU Used: kernel 218 ms, user 266343 ms. Process Utilization 98%. System Idle 0%. Interval: 271588 ms.
<Time Stamp> Server Process 0:0:0 (0xf94) Worker 0x00000000817481A0 appears to be non-yielding on Scheduler 0. Thread creation time: 12925321224306. Approx Thread CPU Used: kernel 234 ms, user 325156 ms. Process Utilization 97%. System Idle 0%. Interval: 333671 ms.
<Time Stamp> Server Process 0:0:0 (0xf94) Worker 0x00000000817481A0 appears to be non-yielding on Scheduler 0. Thread creation time: 12925321224306. Approx Thread CPU Used: kernel 296 ms, user 386000 ms. Process Utilization 97%. System Idle 0%. Interval: 396370 ms.

CAUSE

This issue occurs because SQL Server 2008 or SQL Server 2008 R2 does not release a scheduler correctly.

RESOLUTION

Cumulative update information

SQL Server 2008 R2

The fix for this issue was first released in Cumulative Update 5. For more information about how to obtain this cumulative update package for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:
2438347 Cumulative Update package 5 for SQL Server 2008 R2
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 R2 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:
981356 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 was released

SQL Server 2008 Service Pack 1

The fix for this issue was first released in Cumulative Update 10 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:
2279604 Cumulative update package 10 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 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.

SQL Server 2008 Service Pack 2

The fix for this issue was first released in Cumulative Update 1 for SQL Server 2008 Service Pack 2. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2289254 Cumulative update 1 for SQL Server 2008 Service Pack 2
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:
2402659 The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 2 was released

WORKAROUND

To work around this issue, use a full-text search thesaurus to define the synonyms of the predicate.

To do this, use the FORMSOF function together with the THESAURUS value, and then add all the keywords as parameters.

For the example that is described in the "Symptoms" section, the following is an updated version of the sample query:
Select * from test_table where Contains(*,'FORMSOF (THESAURUS,"architectural","engineer","Mechanical","Engineering","Electronics","Engineer","Electrical","Control","Systems","Project","Manager","Manufacturing","Metallurgy","Metallurgist","Process",”Design”,"Technology","Production","Quality","Control","Civil","Graduate","Recruitment","consultant","trainee","recruitment")')

STATUS

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

REFERENCES

For more information about the CONTAINSTABLE function, visit the following Microsoft Developer Network (MSDN) website:
General information about the CONTAINSTABLE function
For more information about the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
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 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 2344600 - Last Review: December 20, 2010 - Revision: 5.0
APPLIES TO
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Service Pack 1
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Standard Edition for Small Business
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Standard
  • Microsoft SQL Server 2008 R2 Standard Edition for Small Business
  • Microsoft SQL Server 2008 R2 Workgroup
Keywords: 
kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2344600

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com