Skip to content

Commit 77eb7f5

Browse files
committed
Yield to prevent deadlocks
Based on this comment by @danielmarbach: > So the solution here is to do a Yield at the beginning of the event handler or for safety precaution reasons it would be possible to modify to Work class to do it uniformly
1 parent 313e1e8 commit 77eb7f5

File tree

1 file changed

+1
-0
lines changed
  • projects/client/RabbitMQ.Client/src/client/impl

1 file changed

+1
-0
lines changed

projects/client/RabbitMQ.Client/src/client/impl/Work.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public async Task Execute(ModelBase model)
1616
{
1717
try
1818
{
19+
await Task.Yield();
1920
await Execute(model, _asyncConsumer).ConfigureAwait(false);
2021
}
2122
catch (Exception)

0 commit comments

Comments
 (0)