spaghettidba / WorkloadTools

A collection of tools to collect, analyze and replay SQL Server workloads, on premises and in the cloud
MIT License
230 stars 51 forks source link

Uncaught Exception while creating XE Session on SQL 2022 #134

Closed martin-guth closed 7 months ago

martin-guth commented 10 months ago

I am running WorkloadTools 1.6.2. When aiming it to SQL 2022 (specifically CU6) to record a workload for the first time I got the following error message (see below). It seems that the XEvent restrictions have changed for SQL 2022. As a workaround I edited C:\Program Files\WorkloadTools\Listener\ExtendedEvents\sqlworkload.sql from _NO_EVENTLOSS TO _ALLOW_SINGLE_EVENTLOSS Nice one @spaghettidba that you made this config so accessible. Then WorkloadTools starts as usual and records the workload.

Info - WorkloadTools.Listener.ExtendedEvents.ExtendedEventsWorkloadListener : Reading Extended Events session definition from C:\Program Files\WorkloadTools\Listener\ExtendedEvents\sqlworkload.sql Error - WorkloadTools.WorkloadController : Uncaught Exception Error - WorkloadTools.WorkloadController : The event, "sqlserver.attention", can not be added to an event session that specifies no event loss. Error - WorkloadTools.WorkloadController : at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at WorkloadTools.Listener.ExtendedEvents.ExtendedEventsWorkloadListener.Initialize() in C:\github\WorkloadTools\WorkloadTools\Listener\ExtendedEvents\ExtendedEventsWorkloadListener.cs:line 135 at WorkloadTools.WorkloadController.Run() in C:\github\WorkloadTools\WorkloadTools\WorkloadController.cs:line 42