Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/Grains/TestGrains/DeadlockGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public class CallChainReentrancyGrain : Grain, ICallChainReentrancyGrain
public async Task CallChain(ICallChainObserver observer, List<(string TargetGrain, ReentrancyCallType CallType)> callChain, int callIndex, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
var unblocker = _unblocker;
await observer.OnEnter(Id, callIndex);
try
{
Expand All @@ -100,19 +101,19 @@ public async Task CallChain(ICallChainObserver observer, List<(string TargetGrai
switch (op.CallType)
{
case ReentrancyCallType.Regular:
await Task.WhenAny(_unblocker.Task, target.CallChain(observer, newChain, nextCallIndex, cancellationToken));
await Task.WhenAny(unblocker.Task, target.CallChain(observer, newChain, nextCallIndex, cancellationToken));
break;
case ReentrancyCallType.AllowCallChainReentrancy:
{
using var _ = RequestContext.AllowCallChainReentrancy();
await Task.WhenAny(_unblocker.Task, target.CallChain(observer, newChain, nextCallIndex, cancellationToken));
await Task.WhenAny(unblocker.Task, target.CallChain(observer, newChain, nextCallIndex, cancellationToken));
break;
}

case ReentrancyCallType.SuppressCallChainReentrancy:
{
using var _ = RequestContext.SuppressCallChainReentrancy();
await Task.WhenAny(_unblocker.Task, target.CallChain(observer, newChain, nextCallIndex, cancellationToken));
await Task.WhenAny(unblocker.Task, target.CallChain(observer, newChain, nextCallIndex, cancellationToken));
break;
}
}
Expand Down
Loading