backport of commit c3ee4fa9ff

pull/4853/head
Todd 2 years ago
parent 7c2987daca
commit 40792f31c5

@ -273,14 +273,14 @@ func (p *ClientProxy) Start(opt ...Option) (retErr error) {
// might as well leave it open so the next connection can be // might as well leave it open so the next connection can be
// tried. // tried.
sess, err := sessions.NewClient(p.apiClient).Read(p.ctx, p.sessionAuthzData.SessionId) sess, err := sessions.NewClient(p.apiClient).Read(p.ctx, p.sessionAuthzData.SessionId)
if err != nil || sess == nil || sess.Item == nil || sess.Item.TerminationReason == "" { if err != nil || sess == nil || sess.Item == nil || sess.Item.Status == "active" {
return return
} }
// We got a valid session response for the session we just // We got a valid session response for the session we just
// closed a connection for. Since there is a termination reason // closed a connection for. Since the status isn't active
// we can treat the session as being terminated so no more // we can treat the session as no longer being able to
// connections will be able to be established. // suport connections so close this proxy.
fin <- fmt.Errorf("session no longer active") fin <- fmt.Errorf("session no longer active")
listenerCloseFunc() listenerCloseFunc()
p.cancel() p.cancel()

Loading…
Cancel
Save