Conversation
|
@claude review it |
PR Review: [TAM-2029] wrong ttl alert notification fixedFile: The intent of this PR — preventing timeout values from polluting the value cache and triggering incorrect TTL alert notifications — is correct. However, the implementation introduces a critical regression and leaves a secondary bug unaddressed. 🔴 Critical Bug: Double EnqueueThe PR adds an unconditional Current code after the PR (lines 85–99): _cache.Enqueue(value); // ← added by this PR
if (_cache.Count > CacheSize)
_cache.TryDequeue(out _);
if (_lastValue is null || value.Time >= _lastValue.Time)
{
_lastValue = value;
_to = value.Time;
_cache.Enqueue(value); // ← was already here, not removed
if (_cache.Count > CacheSize)
_cache.TryDequeue(out _);
}Impact:
Fix: Remove the 🟡 Secondary Bug: Stale Timeout Values Fall ThroughThe guard condition is: if (value.IsTimeout && (_lastTimeout is null || _lastTimeout.ReceivingTime < value.ReceivingTime))
{
_lastTimeout = value;
return;
}When
In the original code this was also a latent issue (the stale timeout could update Suggested fix: Move the if (value.IsTimeout)
{
if (_lastTimeout is null || _lastTimeout.ReceivingTime < value.ReceivingTime)
_lastTimeout = value;
return;
}✅ What the PR Gets Right
Summary
The double-enqueue bug should be fixed before merging. The stale-timeout issue should be addressed in the same change to fully resolve the TTL alert problem. |
No description provided.