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