From 6f2571980c2688cbfd5ed0bf2a0cbf753d3352c6 Mon Sep 17 00:00:00 2001 From: ChristLZS <50512605+ChristLZS@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:43:58 +0800 Subject: [PATCH] [client] Fixed a bug where service loops reconnection after disconnection.service is shut down and can not exit goroutine (#3012) Co-authored-by: lizhisheng --- client/service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/service.go b/client/service.go index 30bd3f8..3a08d4e 100644 --- a/client/service.go +++ b/client/service.go @@ -198,6 +198,10 @@ func (svr *Service) keepControllerWorking() { } for { + if atomic.LoadUint32(&svr.exit) != 0 { + return + } + xl.Info("try to reconnect to server...") conn, session, err := svr.login() if err != nil {