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

Wrap pipeline failures in RecordConnectionFailed

parent 98dc7df2
...@@ -698,8 +698,16 @@ internal static int WriteRaw(Span<byte> span, long value, bool withLengthPrefix ...@@ -698,8 +698,16 @@ internal static int WriteRaw(Span<byte> span, long value, bool withLengthPrefix
internal void WakeWriterAndCheckForThrottle() internal void WakeWriterAndCheckForThrottle()
{ {
var flush = _ioPipe.Output.FlushAsync(); try
if (!flush.IsCompletedSuccessfully) flush.AsTask().Wait(); {
var flush = _ioPipe.Output.FlushAsync();
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