Commit 12322121 authored by Marc Gravell's avatar Marc Gravell

simplify EOF reporting

parent 3e5e3476
......@@ -307,7 +307,7 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
if (complete)
{
ActiveMultiplexers.Remove(handle);
}
}
}
Writer.WriteLine((complete ? "Closed (" : "Closing... (") + count.ToString() + " remaining)");
......
......@@ -1341,15 +1341,24 @@ private void OnDebugAbort()
// this CEX is just a hardcore "seriously, read the actual value" - there's no
// convenient "Thread.VolatileRead<T>(ref T field) where T : class", and I don't
// want to make the field volatile just for this one place that needs it
if (isReading && Volatile.Read(ref _ioPipe) == null)
if (isReading)
{
// yeah, that's fine... don't worry about it
}
else
{
Trace("Faulted");
RecordConnectionFailed(ConnectionFailureType.InternalFailure, ex);
var pipe = Volatile.Read(ref _ioPipe);
if (pipe == null)
{
return;
// yeah, that's fine... don't worry about it; we nuked it
}
// check for confusing read errors - no need to present "Reading is not allowed after reader was completed."
if (pipe is SocketConnection sc && sc.ShutdownKind == PipeShutdownKind.ReadEndOfStream)
{
RecordConnectionFailed(ConnectionFailureType.SocketClosed, new EndOfStreamException());
return;
}
}
Trace("Faulted");
RecordConnectionFailed(ConnectionFailureType.InternalFailure, ex);
}
}
......
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