whuanle/CZGL.SystemInfo

Input string was not in a correct format 导致进程崩溃

Closed this issue · 1 comments

LGinC commented

nuget: <PackageReference Include="CZGL.ProcessMetrics" Version="1.0.0" />
runtime: aspnet:5.0-alpine

Error:
Unhandled exception. System.Diagnostics.Tracing.EventSourceException: An error occurred when writing to a listener.
---> System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Number.ParseDecimal(ReadOnlySpan1 value, NumberStyles styles, NumberFormatInfo info) at CZGL.ProcessMetrics.Counters.EventSourceCreatedListener.GetRelevantMetric(IDictionary2 eventPayload)
at CZGL.ProcessMetrics.Counters.EventSourceCreatedListener.OnEventWritten(EventWrittenEventArgs eventData)
at System.Diagnostics.Tracing.EventSource.DispatchToAllListeners(Int32 eventId, EventWrittenEventArgs eventCallbackArgs)
--- End of inner exception stack trace ---

出现得很频繁,基本启动10分钟就挂了

目测是这里报错了

建议添加全局异常处理, 不让程序崩掉

你好,已经修复了此问题,增加其它可靠性代码。