You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If at least one IdleDuration object is non-null, a non-null value will be returned always. This will clear the entire chain in DefaultPartitionedRateLimiter.Heartbeat. Even if there are active limiters with nullable idleDuration.
public override TimeSpan? IdleDuration
{
get
{
ThrowIfDisposed();
TimeSpan? lowestIdleDuration = null;
foreach (RateLimiter limiter in _limiters)
{
if (limiter.IdleDuration is { } idleDuration)
{
if (lowestIdleDuration is null || idleDuration < lowestIdleDuration)
{
lowestIdleDuration = idleDuration;
}
}
}
return lowestIdleDuration;
}
}
ChainedRateLimiter not implements ReplenishingRateLimiter
Because of this, the TryReplenish method will not be called for the chain of child objects.
See DefaultPartitionedRateLimiter.Heartbeat
Reproduction Steps
I tried to use this class and caught the described bugs.
Activity
dotnet-policy-service commentedon Mar 14, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
[-]ChainedRateLimiter[/-][+]System.Threading.RateLimiting.ChainedRateLimiter[/+]dotnet-policy-service commentedon Mar 14, 2026
Tagging subscribers to this area: @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.
fix `ChainedRateLimiter` treating `IdleDuration` and chained `Repleni…
fix `ChainedRateLimiter` treating `IdleDuration` and chained `Repleni…