mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 10:26:52 +01:00
Stop a deleted handshake's retry timers from driving the handshake that replaced it
This commit is contained in:
1 parent
5bf666dd90
commit
e5ac0cc5e2
4 files changed
+93
-21
No files matched your search
+5
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user