mapper: keep one batched bundle per node in flight to preserve order

A saturated worker pool could deliver a later tick before an earlier one.
This commit is contained in:
Kristoffer Dalby authored and Kristoffer Dalby committed 2026-06-08 10:04:49 +02:00
1 parent a518a5076a
commit efdd9463e9
3 files changed
+66 -2

No files matched your search

+7
View File
@@ -56,6 +56,13 @@ type multiChannelNodeConn struct {
// Range in [multiChannelNodeConn.computePeerDiff]).
workMu sync.Mutex
// inFlight is true while a batched work bundle for this node is queued or
// being processed. processBatchedChanges refuses to queue a second bundle
// while one is in flight (the new changes wait in pending), so a saturated
// worker pool cannot deliver tick N+1 before tick N: a non-FIFO workMu
// cannot reorder bundles that never coexist.
inFlight atomic.Bool
closeOnce sync.Once
updateCount atomic.Int64