You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by jo...@apache.org on 2021/01/04 14:57:00 UTC

[dubbo-go] 01/02: Merge pull request #944 from georgehao/develop

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

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

commit e4eb1f6daf6ac1f6fa28e43efecf3246e39d3933
Author: Joe Zou <jo...@apache.org>
AuthorDate: Sun Dec 20 22:32:20 2020 +0800

    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 d8f096b..31974aa 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))