Stop a deleted handshake's retry timers from driving the handshake that replaced it

This commit is contained in:
JackDoan committed 2026-10-16 16:14:53 -05:00
1 parent 5bf666dd90
commit e5ac0cc5e2
4 files changed
+93 -21

No files matched your search

+5 -2
View File
@@ -147,7 +147,10 @@ func (tw *TimerWheel[T]) Purge() (T, bool) {
tw.expired.Tail = nil
}
// Clear out the items references
// Clear out the items references, a cached item must not keep its value alive
v := ti.Item
var zero T
ti.Item = zero
ti.Next = nil
// Maybe cache it for later
@@ -157,7 +160,7 @@ func (tw *TimerWheel[T]) Purge() (T, bool) {
tw.itemsCached++
}
return ti.Item, true
return v, true
}
// findWheel find the next position in the wheel for the provided timeout given the current tick