-1

I’m encountering the following error in the SQL Server error log: resource governer

2024-12-03 11:21:01.860 spid568 Error: 10982, Severity: 16, State: 1.
2024-12-03 11:21:01.860 spid568 Failed to run resource governor classifier user-defined function 'dbo.fn_Classifier'. Last error 3602, state 118. See previous errors in SQL Server error log from session ID 568 for details. Classifier elapsed time: 0 ms.

Observations:

  1. The classifier function is used in Resource Governor.
  2. Error 3602 typically relates to invalid conditions or state in SQL Server.
  3. The error suggests that the function failed during classification, preventing proper processing.

My Questions:

  1. What are the common causes for a classifier function to fail in Resource Governor?

  2. Are there any best practices I should follow to ensure classifier functions execute correctly?

  3. What steps can I take to troubleshoot this issue? Are there specific diagnostic tools or approaches to isolate the root cause?

Defenition :

CREATE FUNCTION fn_Classifier
()
RETURNS sysname
WITH SCHEMABINDING
AS
BEGIN
    DECLARE @ReturnValue AS sysname;
    IF (SUSER_NAME() NOT IN (N'##MS_PolicyTsqlExecutionLogin##',N'aaaaa',N'bbbbb',N'bbbbbb',N'ccccc',N'fffff'
                            )
        AND SUSER_NAME() NOT LIKE N'%App%'
       )
        SET @ReturnValue = 'Productionuser_WLG';
    ELSE
        SET @ReturnValue = 'default';
    RETURN @ReturnValue;
END;
GO

Any guidance would be greatly appreciated. Thank you!

New contributor
Mohamadreza is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
6
  • And what is the definition of dbo.fn_Classifier Commented Dec 8 at 17:41
  • Add definition to question @Charlieface Commented Dec 9 at 9:01
  • OK is that function defined in the master database? Which exact build number of SQL Server is this select @@version Are you having any other issues, such as memory pressure, hardware issues, issues logging in, etc? Are there any other logs that might be relevant or unusual? Commented Dec 9 at 10:41
  • Additional information: Yes, this function is on the master database. Its version is Microsoft SQL Server 2022 (RTM-CU12-GDR)(KB5036343)Core-based (64-bit) . This server is the primary AG node and there is also a secondary node. This server has about 300 2GB style databases. Often this error is also thrown: The client was unable to reuse a session with SPID 136, which had been reset for connection pooling. The failure ID is 46. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.@Charlieface Commented yesterday
  • Well you are about 9 months out of date on updates. Try updating to CU16 learn.microsoft.com/en-us/troubleshoot/sql/releases/… Commented yesterday

0

Browse other questions tagged or ask your own question.