From 83a75ee1b0caf8cabc30a01b1ec45897e98f1764 Mon Sep 17 00:00:00 2001 From: Oncilla Date: Thu, 4 Oct 2018 16:36:45 +0200 Subject: [PATCH] SIG: Avoid using path removed from path pool (#1923) Set the path for the worker immediately if the current path is no longer part of the path pool. --- go/sig/egress/session/sessmon.go | 5 +++++ go/sig/egress/worker/worker.go | 1 + 2 files changed, 6 insertions(+) diff --git a/go/sig/egress/session/sessmon.go b/go/sig/egress/session/sessmon.go index 31db3aab47..c090037187 100644 --- a/go/sig/egress/session/sessmon.go +++ b/go/sig/egress/session/sessmon.go @@ -143,6 +143,11 @@ func (sm *sessMonitor) updateRemote() { sm.Debug("Current path invalid", "remote", currRemote) currSessPath = sm.getNewPath(nil) sm.needUpdate = true + // Traffic must no longer be sent on the old path. This implies that the encap + // traffic is sent on a path that has not been tested by the session monitor yet. + // If the new path is unhealthy, it is changed quickly by the session monitor through + // the regular timeout mechanism above. + sm.sess.currRemote.Store(&egress.RemoteInfo{Sig: currSig, SessPath: currSessPath}) } } sm.sess.healthy.Store(!sm.needUpdate) diff --git a/go/sig/egress/worker/worker.go b/go/sig/egress/worker/worker.go index 6a9e70e459..8527138204 100644 --- a/go/sig/egress/worker/worker.go +++ b/go/sig/egress/worker/worker.go @@ -210,6 +210,7 @@ func (w *worker) resetFrame(f *frame) { if w.currSig != nil { addrLen = uint16(spkt.AddrHdrLen(w.currSig.Host, sigcmn.Host)) } + w.currPathEntry = nil if remote.SessPath != nil { w.currPathEntry = remote.SessPath.PathEntry() }