我有一个使用在 Service Fabric 上运行的 EventFlow 的 ETW 侦听器。
这是我的配置文件(eventFlowConfig.json):
{
"inputs": [
{
"type": "ETW",
"sessionNamePrefix": "MyListenerService",
"cleanupOldSessions": true,
"reuseExistingSession": true,
"providers": [
{
"providerName": "Provider0"
}
]
}
],
"filters": [],
"outputs": [
{
"type": "CustomOutput"
}
],
"schemaVersion": "2018-04-04",
"extensions": [
{
"category": "outputFactory",
"type": "CustomOutput",
"qualifiedTypeName": "MyNamespace.EventFlow.Outputs.CustomOutputFactory, MyAssembly"
}
]
}
这是我的切入点:
private static void Main()
{
try
{
string configurationFileName = "eventFlowConfig.json";
using (var diagnosticsPipeline = ServiceFabricDiagnosticPipelineFactory.CreatePipeline("MyService", configurationFileName))
{
ServiceRuntime.RegisterServiceAsync("MyServiceType",
context => new Service(context)).GetAwaiter().GetResult();
ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(Service).Name);
// Prevents this host process from terminating so services keeps running.
Thread.Sleep(Timeout.Infinite);
}
}
catch (Exception e)
{
ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
throw;
}
}
当我在调试时在本地集群中多次启动/停止我的服务时,我得到了这个异常:
System.Runtime.InteropServices.COMException: 'Insufficient system resources exist to complete the requested service. (Exception from HRESULT: 0x800705AA)'
在重新启动计算机之前,我无法重新启动服务。问题是我在本地以外的其他环境中遇到了同样的异常。
我试过这个:ServiceFabric 应用程序中的 TraceEventSession 使用引发资源不足错误:我的服务是无状态的,并且只有一个节点实例。
此配置是否足以释放/重用 ETW 会话?
"sessionNamePrefix": "MyListenerService",
"cleanupOldSessions": true,
"reuseExistingSession": true,
有没有其他人遇到过这个问题?
编辑
在@Diego Mendes 的回答之后,我已经执行了这个logman -ets
...
EventFlow-EtwInput-a8aefb3c-594f-4ac7-b9d8-6da1791fb122 Trace Running
EventFlow-EtwInput-fe5f58e6-d1a7-4198-95b2-d343584cf46b Trace Running
EventFlow-EtwInput-33f67287-5563-4835-b3a1-5527e4fc5e5e Trace Running
EventFlow-EtwInput-959eef04-a5ae-47eb-9b7e-057a9fd3fb28 Trace Running
EventFlow-EtwInput-0095f186-d657-4974-a613-213d7eb49def Trace Running
EventFlow-EtwInput-8fbc52f5-2de6-4826-bce2-36d8abf0c264 Trace Running
EventFlow-EtwInput-8e654b40-c299-48f4-818e-5ebe3c2341a4 Trace Running
EventFlow-EtwInput-7ec63ec9-428b-4658-b059-698b5ae66986 Trace Running
EventFlow 忽略了我sessionNamePrefix
并用EventFlow-EtwInput
? 可能是 EventFlow 的错误?
我会尝试EventFlow-EtwInput
用作我的sessionNamePrefix
.