mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 10:16:52 +01:00
relay: Let WriteBatch handle destination changes and drop the flush before responses
This commit is contained in:
1 parent
d3e21a8fc8
commit
3db4c89e9e
3 files changed
+15
-85
No files matched your search
+4
-3
@@ -384,8 +384,8 @@ type rxContext struct {
|
||||
hostmapCache map[uint32]*HostInfo
|
||||
lhh *LightHouseHandler
|
||||
ctCache *firewall.ConntrackCacheTicker
|
||||
relayBatch *batch.SendBatch
|
||||
relayRemote netip.AddrPort
|
||||
// relayBatch holds forwarded relay packets, which borrow their receive buffers until flushed
|
||||
relayBatch *batch.SendBatch
|
||||
}
|
||||
|
||||
func newRxContext(f *Interface, q int) *rxContext {
|
||||
@@ -398,6 +398,7 @@ func newRxContext(f *Interface, q int) *rxContext {
|
||||
hostmapCache: map[uint32]*HostInfo{},
|
||||
lhh: f.lightHouse.NewRequestHandler(),
|
||||
ctCache: firewall.NewConntrackCacheTicker(f.ctx, f.l, f.conntrackCacheTimeout),
|
||||
relayBatch: batch.NewSendBatch(f.writers[q], batch.SendBatchCap, 0),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +417,7 @@ func (f *Interface) listenOut(i int) {
|
||||
}
|
||||
|
||||
flusher := func() {
|
||||
f.flushRelayBatch(rxc)
|
||||
f.flushSendBatch(rxc.relayBatch, i)
|
||||
if err := f.batchers[i].Flush(); err != nil {
|
||||
f.l.Error("Failed to flush tun coalescer", "error", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user