Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIG: Fix bug with not pushing the changed path to the Session #2977

Merged
merged 1 commit into from
Aug 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions go/sig/egress/session/sessmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ Top:
case <-sm.sess.sessMonStop:
break Top
case <-reqTick.C:
// Update paths and sigs
sm.sessPathPool.Update(sm.pool.Paths())
sm.updatePaths()
sm.updateRemote()
sm.sendReq()
case rpld := <-regc:
Expand All @@ -113,6 +112,27 @@ Top:
sm.Info("sessMonitor: stopped")
}

func (sm *sessMonitor) updatePaths() {
if sm.smRemote == nil || sm.smRemote.SessPath == nil {
sm.sessPathPool.Update(sm.pool.Paths())
return
}
currPath := sm.smRemote.SessPath
expTime := currPath.PathEntry().Path.ExpTime
mtu := currPath.PathEntry().Path.Mtu
sm.sessPathPool.Update(sm.pool.Paths())
// Expiration or MTU of the current path may have changed during the update.
// In such a case we want to push the updated path to the Session.
if currPath.PathEntry().Path.ExpTime != expTime || currPath.PathEntry().Path.Mtu != mtu {
sm.Trace("sessMonitor: Path metadata changed",
"oldExpiration", expTime,
"newExpiration", currPath.PathEntry().Path.ExpTime,
"oldMTU", mtu,
"newMTU", currPath.PathEntry().Path.Mtu)
sm.updateSessSnap()
}
}

func (sm *sessMonitor) updateRemote() {
// There were no replies from the remote SIG for some time. We don't know whether
// the failure was caused by bad path or bad SIG. Therefore, we choose a different
Expand Down