Commit 839b8f10 authored by Nick Craver's avatar Nick Craver

Wrap pipeline failures in RecordConnectionFailed

parent 98dc7df2
...@@ -697,10 +697,18 @@ internal static int WriteRaw(Span<byte> span, long value, bool withLengthPrefix ...@@ -697,10 +697,18 @@ internal static int WriteRaw(Span<byte> span, long value, bool withLengthPrefix
} }
internal void WakeWriterAndCheckForThrottle() internal void WakeWriterAndCheckForThrottle()
{
try
{ {
var flush = _ioPipe.Output.FlushAsync(); var flush = _ioPipe.Output.FlushAsync();
if (!flush.IsCompletedSuccessfully) flush.AsTask().Wait(); if (!flush.IsCompletedSuccessfully) flush.AsTask().Wait();
} }
catch (ConnectionResetException ex)
{
RecordConnectionFailed(ConnectionFailureType.SocketClosed, ex);
throw;
}
}
private static readonly byte[] NullBulkString = Encoding.ASCII.GetBytes("$-1\r\n"), EmptyBulkString = Encoding.ASCII.GetBytes("$0\r\n\r\n"); private static readonly byte[] NullBulkString = Encoding.ASCII.GetBytes("$-1\r\n"), EmptyBulkString = Encoding.ASCII.GetBytes("$0\r\n\r\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment