mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-02 03:34:06 +09:00
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:
1 parent
a518a5076a
commit
efdd9463e9
3 files changed
+66
-2
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user