FIX: System or background task may fail when number of sessions reaches the maximum limit in SQL Server 2016, 2017 and 2019

Applies to: SQL Server 2016 Service Pack 2SQL Server 2016 DeveloperSQL Server 2016 Enterprise

Symptoms


When the number of sessions that are used by both user connections and system or background tasksreaches the maximum limit (32,767 or fewer, depending on the Userconnections Server Configuration Option) in Microsoft SQL Server 2016 or 2019, arequired system or background task does not run. Additionally, error 17300 may be logged inthe error log. If this task is required for SQL Server to continuerunning as expected (for example, the XE Dispatcher Task), this may cause SQL Server to shutdown.

Status


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

Resolution


This issue is fixed in the following cumulative updates for SQL Server:
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

More Information


In SQL Server,any user connection or system task must be running within a session by having aunique identifier between 1 and 32,767. The first 50 sessions are reserved forsystem tasks, and the rest of the sessions may be shared between the userconnections and system tasks. Notice that the actual number of system tasks willvary depending on the server or database configuration, such as using AvailabilityGroups, running Full-Text search, and so on. If enough user connections are created so as toleave no space for more system tasks, trying to create an additional system task mayfail. Even if the administrator reduces the number of maximum user connectionsthrough the server configuration, space for only 50 system tasks is guaranteed.

This fix increases the number of guaranteed system tasks to at least 500. This means that if the configured number of user connections is set to a default or more than 32,267, the actual number of user connections will belimited to 32,267 to guarantee that 500 system tasks can run. If the user sets thenumber of user connections to less than 32,267, all remaining space up until 32,767 willbe available for the system tasks (as opposed to 50 system tasks before you apply this fix).

References


Learn about the terminology that Microsoft uses to describe software updates.