Skip to content

Commit 3141829

Browse files
committed
Client Request Handle change to start time when request is actually sent, to avoid delays in middleware processing affecting timeout
1 parent 1f34f6b commit 3141829

2 files changed

Lines changed: 223 additions & 227 deletions

File tree

src/MassTransit.Abstractions/Internals/Extensions/TaskExtensions.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,14 @@ public static bool IsCompletedSuccessfully(this Task task)
195195
public static void IgnoreUnobservedExceptions(this Task task)
196196
{
197197
if (task.IsCompleted)
198+
_ = task.Exception;
199+
else
198200
{
199-
if (task.IsFaulted)
201+
task.ContinueWith(t =>
200202
{
201-
var _ = task.Exception;
202-
}
203-
204-
return;
203+
t.Exception?.Handle(_ => true);
204+
}, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously);
205205
}
206-
207-
task.ContinueWith(t =>
208-
{
209-
var _ = t.Exception;
210-
}, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously);
211206
}
212207

213208
public static void TrySetFromTask<T>(this TaskCompletionSource<T> source, Task task, T value)

0 commit comments

Comments
 (0)