From e4eb1f6daf6ac1f6fa28e43efecf3246e39d3933 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Sun, 20 Dec 2020 22:32:20 +0800 Subject: [PATCH 1/3] Merge pull request #944 from georgehao/develop fix: URL.String() data race panic --- common/url.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/url.go b/common/url.go index d8f096bb48..31974aa892 100644 --- a/common/url.go +++ b/common/url.go @@ -317,6 +317,8 @@ func isMatchCategory(category1 string, category2 string) bool { } func (c *URL) String() string { + c.paramsLock.Lock() + defer c.paramsLock.Unlock() var buf strings.Builder if len(c.Username) == 0 && len(c.Password) == 0 { buf.WriteString(fmt.Sprintf("%s://%s:%s%s?", c.Protocol, c.Ip, c.Port, c.Path)) From 75c693d3c0d589bc16497074435f578d7a19405d Mon Sep 17 00:00:00 2001 From: "Xin.Zh" Date: Sun, 20 Dec 2020 22:27:18 +0800 Subject: [PATCH 2/3] Merge pull request #945 from fangyincheng/fix-object fix bug --- .travis.yml | 1 + cluster/router/healthcheck/default_health_check.go | 1 - protocol/dubbo/impl/hessian.go | 4 +--- registry/zookeeper/registry.go | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b338c2779..4f79ecf3bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ install: true # define ci-stage script: + - go fmt ./... && [[ -z `git status -s` ]] # license-check - make verify # integrate-test diff --git a/cluster/router/healthcheck/default_health_check.go b/cluster/router/healthcheck/default_health_check.go index 3effd779c9..378463be56 100644 --- a/cluster/router/healthcheck/default_health_check.go +++ b/cluster/router/healthcheck/default_health_check.go @@ -96,7 +96,6 @@ func (c *DefaultHealthChecker) getCircuitBreakerSleepWindowTime(status *protocol return int64(sleepWindow) } - // GetRequestSuccessiveFailureThreshold return the requestSuccessiveFailureThreshold bound to this DefaultHealthChecker func (c *DefaultHealthChecker) GetRequestSuccessiveFailureThreshold() int32 { return c.requestSuccessiveFailureThreshold diff --git a/protocol/dubbo/impl/hessian.go b/protocol/dubbo/impl/hessian.go index 066400d58b..9f23d365e0 100644 --- a/protocol/dubbo/impl/hessian.go +++ b/protocol/dubbo/impl/hessian.go @@ -37,8 +37,6 @@ import ( "github.com/apache/dubbo-go/common/logger" ) -type Object interface{} - type HessianSerializer struct { } @@ -474,7 +472,7 @@ func getArgType(v interface{}) string { return "java.lang.String" case []string: return "[Ljava.lang.String;" - case []Object: + case []hessian.Object: return "[Ljava.lang.Object;" case map[interface{}]interface{}: // return "java.util.HashMap" diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index 76fc052b6f..fe492c2b12 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -212,7 +212,7 @@ func (r *zkRegistry) registerTempZookeeperNode(root string, node string) error { r.cltLock.Lock() defer r.cltLock.Unlock() - if r.client == nil{ + if r.client == nil { return perrors.WithStack(perrors.New("zk client already been closed")) } err = r.client.Create(root) From 111abaa7064ee1377d3816b3dfe3203f743fae08 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Mon, 4 Jan 2021 23:00:31 +0800 Subject: [PATCH 3/3] Update CHANGE.md --- CHANGE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGE.md b/CHANGE.md index 4fa898847a..c3fdec5581 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -22,7 +22,9 @@ - [Fix: refact heartbeat](https://github.com/apache/dubbo-go/pull/889) - [Fix: router_config add &url to url](https://github.com/apache/dubbo-go/pull/910) - [Fix: Router chain can not build immediately when started](https://github.com/apache/dubbo-go/pull/927) -- [Fix: client block until timeout when provider return with PackageResponse_Exception](https://github.com/apache/dubbo-go/pull/926) +- [Fix: client block until timeout when provider return with PackageResponse_Exception](https://github.com/apache/dubbo-go/pull/926) +- [Fix: URL.String() data race panic](https://github.com/apache/dubbo-go/pull/944) +- [Fix: generic "encode hessian.Object"](https://github.com/apache/dubbo-go/pull/945) ### Dependencies - [Bump github.com/mitchellh/mapstructure from 1.2.3 to 1.3.3](https://github.com/apache/dubbo-go/pull/838)