Skip to content

Commit

Permalink
Throw when lease not acquired. This can happen then the rate limiter …
Browse files Browse the repository at this point in the history
…doesn't allow queuing or is generally wrongly configured
  • Loading branch information
danielmarbach committed Oct 30, 2024
1 parent e1b62d1 commit e466142
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/RabbitMQ.Client/Impl/Channel.PublisherConfirms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ await _confirmSemaphore.WaitAsync(reason.CancellationToken)
lease = await _outstandingPublisherConfirmationsRateLimiter.AcquireAsync(
cancellationToken: cancellationToken)
.ConfigureAwait(false);

if (!lease.IsAcquired)
{
throw new InvalidOperationException("Could not acquire a lease from the rate limiter.");
}
}
}

Expand Down

0 comments on commit e466142

Please sign in to comment.