You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by hu...@apache.org on 2019/06/17 01:53:41 UTC

[dubbo-go] branch master updated: Fix: close client before close sessions to defeat client stop too slowly when got a signal

This is an automated email from the ASF dual-hosted git repository.

huxing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 36ff235  Fix: close client before close sessions to defeat client stop too slowly when got a signal
     new 23f39b2  Merge pull request #97 from divebomb/master
36ff235 is described below

commit 36ff2350955a9f394bb393b28b20836b3e494114
Author: AlexStocks <al...@foxmail.com>
AuthorDate: Sun Jun 16 22:05:43 2019 +0800

    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 0ab43ed..c3b106e 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