Commit 5183f1d4 authored by Marc Gravell's avatar Marc Gravell

no need to process result if timed out

parent b719bc48
......@@ -587,14 +587,16 @@ internal void Cancel(Exception ex = null)
// true if ready to be completed (i.e. false if re-issued to another server)
internal bool ComputeResult(PhysicalConnection connection, RawResult result)
{
var box = resultBox;
try
{
if (box != null && box.IsFaulted) return false; // already failed (timeout, etc)
return resultProcessor == null || resultProcessor.SetResult(connection, this, result);
}
catch (Exception ex)
{
resultBox?.SetException(ex);
return true; // we still want to pulse/complete
box?.SetException(ex);
return box != null; // we still want to pulse/complete
}
}
......
......@@ -9,6 +9,7 @@ internal abstract partial class ResultBox
{
protected Exception _exception;
public abstract bool IsAsync { get; }
public bool IsFaulted => _exception != null;
public void SetException(Exception exception) => _exception = exception;
......
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