Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ private async Task<long> WaitForCommittedBindAsync(
string actorId,
CancellationToken ct)
{
using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
timeoutCts.CancelAfter(_options.BindCommitTimeout);
using var bindTimeoutCts = new CancellationTokenSource(_options.BindCommitTimeout);
using var readCts = CancellationTokenSource.CreateLinkedTokenSource(ct, bindTimeoutCts.Token);
try
{
await foreach (var observed in sink.ReadAllAsync(timeoutCts.Token))
await foreach (var observed in sink.ReadAllAsync(readCts.Token))
{
if (TryObserveCommittedBind(
observed,
Expand All @@ -296,7 +296,7 @@ private async Task<long> WaitForCommittedBindAsync(
}
}
}
catch (OperationCanceledException ex) when (!ct.IsCancellationRequested && timeoutCts.IsCancellationRequested)
catch (OperationCanceledException ex) when (bindTimeoutCts.IsCancellationRequested)
{
throw BindNotCommitted(definition, actorId, ex);
}
Expand Down
Loading