From 36ff2350955a9f394bb393b28b20836b3e494114 Mon Sep 17 00:00:00 2001 From: AlexStocks Date: Sun, 16 Jun 2019 22:05:43 +0800 Subject: [PATCH] Fix: close client before close sessions to defeat client stop too slowly when got a signal --- protocol/dubbo/pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/dubbo/pool.go b/protocol/dubbo/pool.go index 0ab43ede7f..c3b106efcb 100644 --- a/protocol/dubbo/pool.go +++ b/protocol/dubbo/pool.go @@ -225,13 +225,13 @@ func (c *gettyRPCClient) close() error { c.once.Do(func() { // delete @c from client pool c.pool.remove(c) + c.gettyClient.Close() + c.gettyClient = nil for _, s := range c.sessions { logger.Infof("close client session{%s, last active:%s, request number:%d}", s.session.Stat(), s.session.GetActive().String(), s.reqNum) s.session.Close() } - c.gettyClient.Close() - c.gettyClient = nil c.sessions = c.sessions[:0] c.created = 0