You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Scenario 3**: The database engine displays a session_id from the "SQLAgent - Generic Refresher" service and the following job is displayed as query text running in that session: `EXECUTE msdb.dbo.sp_sqlagent_refresh_job`
65
-
66
-
You can use the following query to check for such session and text:
When this issue occurs, the session is in a _RUNNABLE_ state, and regularly waits for the `PREEMPTIVE_OS_LOOKUPACCOUNTSID` wait type. Or, the session is in a waiting state for the `ASYNC_NETWORK_IO` wait type.
64
+
-**Scenario 3**: The database engine displays a `session_id` from the _SQLAgent - Generic Refresher_ service and the following job is displayed as query text running in that session: `EXECUTE msdb.dbo.sp_sqlagent_refresh_job`
78
65
79
66
## Cause 1: Multiple job entries
80
67
@@ -148,6 +135,43 @@ For information about the ODBC driver requirements for different versions of SQL
148
135
Get-Service -Name SQLAgent$<InstanceName>
149
136
```
150
137
138
+
## Cause 3: Waiting for "SQLAgent - Generic Refresher" service
139
+
140
+
When SQL Server Agent starts, the _SQLAgent – Generic Refresher_ component runs the `msdb.dbo.sp_sqlagent_refresh_job` procedure to refresh job metadata. During this operation, SQL Server might repeatedly check Windows group membership for job owners or proxy accounts. These checks use Windows API calls, which can cause the session to enter one or more of the following wait types:
141
+
142
+
- `PREEMPTIVE_OS_LOOKUPACCOUNTSID`
143
+
- `PREEMPTIVE_OS_AUTHORIZATIONOPS`
144
+
- `ASYNC_NETWORK_IO`
145
+
146
+
Use the following query to identify the session and the associated command text:
147
+
148
+
```sql
149
+
SELECT
150
+
s.session_id,
151
+
r.status,
152
+
r.wait_type,
153
+
r.wait_time,
154
+
s.program_name,
155
+
t.text
156
+
FROM sys.dm_exec_requests AS r
157
+
RIGHT JOIN sys.dm_exec_sessions AS s
158
+
ON r.session_id = s.session_id
159
+
OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
160
+
WHERE s.program_name = 'SQLAgent - Generic Refresher';
161
+
```
162
+
163
+
When this issue occurs, the session is in a _RUNNABLE_ state, and regularly waits for the `PREEMPTIVE_OS_LOOKUPACCOUNTSID` wait type. Or, the session is in a waiting state for the `ASYNC_NETWORK_IO` wait type.
164
+
165
+
### Workaround
166
+
167
+
To reduce delays related to Windows authorization lookups:
168
+
169
+
- Ensure domain controllers are reachable and responsive.
170
+
- Avoid using highly nested or very large Active Directory groups for SQL Agent job ownership or proxy accounts.
171
+
- Restart SQL Server Agent after significant Active Directory group membership changes to refresh the service account’s access token.
172
+
- Consider using SQL logins instead of AD groups for job ownership when appropriate.
173
+
- Review SQL Agent jobs and proxies to identify Windows principals that might contribute to expensive Windows security lookups.
174
+
151
175
## More information
152
176
153
177
- For more information about how to delete a job, see [Delete One or More Jobs](/sql/ssms/agent/delete-one-or-more-jobs).
0 commit comments