mapper: keep pings when a full update collapses pending changes

A full renders state at drain time but cannot carry a one-shot
PingRequest; queue each ping as a ping-only frame after the full.
This commit is contained in:
Kristoffer Dalby authored and Kristoffer Dalby committed 2026-10-07 15:25:25 +02:00
1 parent e93f5d6ee0
commit d4948da301
8 files changed
+385 -5

No files matched your search

+8
View File
@@ -262,6 +262,14 @@ func (mc *multiChannelNodeConn) prependPending(changes ...change.Change) {
mc.pendingMu.Unlock()
}
// collapsePendingToFull replaces pending, together with incoming, by a
// single full update and the pings it cannot carry ([change.CollapseToFull]).
func (mc *multiChannelNodeConn) collapsePendingToFull(incoming []change.Change) {
mc.pendingMu.Lock()
mc.pending = change.CollapseToFull(mc.id, slices.Concat(mc.pending, incoming))
mc.pendingMu.Unlock()
}
// drainPending atomically removes and returns all pending changes.
// Returns nil if there are no pending changes.
func (mc *multiChannelNodeConn) drainPending() []change.Change {