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 {