From 8a4ff813b1abe4e6d5d764f0dee0c44a82af57e0 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Wed, 30 Aug 2023 17:14:29 -0400 Subject: [PATCH] Put api session into tunnel state after looking up from cache. Fixes #1597 --- controller/handler_edge_ctrl/common_tunnel.go | 1 + router/xgress_edge_tunnel/fabric.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controller/handler_edge_ctrl/common_tunnel.go b/controller/handler_edge_ctrl/common_tunnel.go index ab670bbe3..bc7a1ddee 100644 --- a/controller/handler_edge_ctrl/common_tunnel.go +++ b/controller/handler_edge_ctrl/common_tunnel.go @@ -139,6 +139,7 @@ func (self *baseTunnelRequestContext) ensureApiSessionLocking(configTypes []stri if _, _, err := self.handler.getAppEnv().GetManagers().ApiSession.MarkLastActivityByTokens(self.apiSession.Token); err != nil { logger.WithError(err).Error("unexpected error while marking api session activity") } + state.setCurrentApiSessionId(apiSession.Id) return true } } diff --git a/router/xgress_edge_tunnel/fabric.go b/router/xgress_edge_tunnel/fabric.go index a55c78f46..fdbbeb6d1 100644 --- a/router/xgress_edge_tunnel/fabric.go +++ b/router/xgress_edge_tunnel/fabric.go @@ -239,8 +239,9 @@ func (self *fabricProvider) TunnelService(service tunnel.Service, terminatorInst } if response.ApiSession != nil { - log.WithField("apiSessionId", response.ApiSession.SessionId).Info("received new apiSession") - self.updateApiSession(ctrlCh.Id(), response.ApiSession) + if self.updateApiSession(ctrlCh.Id(), response.ApiSession) { + log.WithField("apiSessionId", response.ApiSession.SessionId).Info("received new apiSession") + } } if response.Session != nil && response.Session.SessionId != sessionId {