etishor / Metrics.NET

The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The semaphore timeout period has expired

miketrusov opened this issue · comments

I've a couple of services running on the same virtual using metrics.net, and occasionally 1 of them starts throwing this error. I think it may be caused by network hiccups. It doesn't recover from it automatically, so I have to restart the service to fix it (possibly because HttpListener is re-initialised?).

2015-10-20 08:04:49.519 +10:00 [Error] Metrics: Unhandled exception in Metrics.NET Library "Error processing HTTP request" "The semaphore timeout period has expired" System.Net.HttpListenerException (0x80004005): The semaphore timeout period has expired at System.Net.HttpResponseStream.EndWrite(IAsyncResult asyncResult) at System.IO.Stream.<BeginEndWriteAsync>b__17(Stream stream, IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncTrimPromise1.Complete(TInstance thisRef, Func3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.IO.StreamWriter.d__1e.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.IO.StreamWriter.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Metrics.Visualization.MetricsHttpListener.d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Metrics.Visualization.MetricsHttpListener.d__4.MoveNext()`