Error Reporting and Diagnosis
This topic describes the capabilities provided in StreamInsight for handling process and query failures and generating dumps for further problem diagnosis. On Windows Vista and Windows Server 2008 and higher operating systems, StreamInsight uses Windows Error Reporting for error reporting and dump generation. On Windows XP and Windows Server 2003 operating systems, StreamInsight uses the version of Dr. Watson (DW20.exe and DWWin.exe) that is included in .NET 3.5 for error reporting and dump generation.
Because StreamInsight uses these standard Windows operating system tools for error reporting and dump generation, it relies on the user consent for error reporting that is set at the Windows operating system level. When the user consent for error reporting is enabled at the operating system level, error reports and dumps for client applications are automatically sent to Microsoft and the dumps are removed from the local server. To investigate dumps for troubleshooting purposes, you must disable error reporting. Consult with the administrator of the server that is running the StreamInsight application to determine if error reporting is enabled on that machine. You change the settings as described in the following sections.
Dumps are generated for StreamInsight application under two scenarios.
StreamInsight can be deployed in an embedded server or a hosted server configuration. For global unhandled exceptions in either of these configurations, the failure is similar to a failure in any CLR application and the Windows operating system will generate a process dump. For example, consider an unhandled exception that is raised in a module invoked on a separate thread by a user-defined function or operator, or an unhandled exception from the adapter.
An exception in a StreamInsight query may not necessarily result in a StreamInsight process failure in either the embedded or hosted server configuration. For example, consider an exception from a user-defined function or operator. You can instrument your application query using the StreamInsight diagnostics API to generate debug dumps programmatically as shown in the following example. However, note that for Windows XP and Windows Server 2003, causing dumps to be generated will cause the process to fail. This is not the case with Windows Vista and Windows Server 2008, and higher
Server server = Server.Create(...); // or Server.Connect(...) if this is a client application connecting to a server. ... // Generate error reports when a query fails. DiagnosticSettings settings = new DiagnosticSettings(DiagnosticAspect.GenerateErrorReports, DiagnosticLevel.Always); server.SetDiagnosticSettings(new Uri("cep:/Server"), settings);
By default, error reports are sent to Microsoft when the error reporting user consent is enabled.
Any Windows application can embed the StreamInsight server. When that application executable fails, the error reporting user consent setting determines if the error is sent to Microsoft. Depending on the cause of the error, the StreamInsight call stack and other information may be part of the error dump. StreamInsight does not have any instrumentation that intervenes with this process.
Reporting query failures also follows the same consent policy described earlier for reporting process failures. However, after you have programmatically enabled generation of dumps for query failures as described earlier, you can choose to retain the dumps and errors in the local server where the error occurred.
To do this, you must turn off automated error reporting for StreamInsight by using the following registry key setting.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent]
For both the process and query failure scenarios, you can inspect errors by viewing Problem Reports and Solutions from the Control Panel. To view errors in Windows 7 and Windows Server 2008 R2, from the Control Panel click Action Center, click Maintenance, click View reliability history, and then click View all problem reports. The errors are reported against the name of your application (for example, MyApplication_name.exe) or against StreamInsightHost.exe.
To turn off error reporting, thereby causing dumps to be saved to the local host, follow the instructions in this Microsoft support article. The error reports are queued and located in the directory %USERPROFILE%\Local Settings\Application Data\PCHealth\ErrorRep or %SYSTEMROOT%\PCHEALTH\ErrorRep\QSignoff.
Administrators with access to the error reporting interface can view the errors in the queue and choose to send the errors to Microsoft on a case by case basis. The operating system retains a maximum limit on the number of entries in the queue. The limit depends on system parameters. Once this limit is exceeded, the operating system does not enqueue any more new failure reports into the queue. Therefore, we recommend that an administrator review these queues regularly for any errors that require further investigation. You can optionally call dw20.exe to flush the queue; otherwise, the reports remain indefinitely.