Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetEndpointMap 在并发下 出现data race #523

Open
Lvzhenqian opened this issue Aug 31, 2021 · 0 comments
Open

GetEndpointMap 在并发下 出现data race #523

Lvzhenqian opened this issue Aug 31, 2021 · 0 comments

Comments

@Lvzhenqian
Copy link

  • 产品和接口: golang sdk
  • 平台: centos 7
  • 最小代码:
==================
WARNING: DATA RACE
Read at 0x000004cbf9d0 by goroutine 36:
  github.com/aliyun/alibaba-cloud-sdk-go/services/rds.GetEndpointMap()
      /home/charles/codes/golang/yw-assist/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/rds/endpoint.go:11 +0x3e
  github.com/aliyun/alibaba-cloud-sdk-go/services/rds.SetEndpointDataToClient()
      /home/charles/codes/golang/yw-assist/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/rds/client.go:41 +0x33
  github.com/aliyun/alibaba-cloud-sdk-go/services/rds.NewClientWithAccessKey()
      /home/charles/codes/golang/yw-assist/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/rds/client.go:82 +0x10a
  yw-assist/AliSDK.NewDefaultRdsClient()
      /home/charles/codes/golang/yw-assist/AliSDK/Rds.go:29 +0xc6
  yw-assist/AliSDK.getRdsInfo()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:28 +0x64
  yw-assist/AliSDK.getRegionInfo.func2()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:185 +0xbb

Previous write at 0x000004cbf9d0 by goroutine 37:
  github.com/aliyun/alibaba-cloud-sdk-go/services/rds.GetEndpointMap()
      /home/charles/codes/golang/yw-assist/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/rds/endpoint.go:12 +0x148
  github.com/aliyun/alibaba-cloud-sdk-go/services/rds.SetEndpointDataToClient()
      /home/charles/codes/golang/yw-assist/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/rds/client.go:41 +0x33
  github.com/aliyun/alibaba-cloud-sdk-go/services/rds.NewClientWithAccessKey()
      /home/charles/codes/golang/yw-assist/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/rds/client.go:82 +0x10a
  yw-assist/AliSDK.NewDefaultRdsClient()
      /home/charles/codes/golang/yw-assist/AliSDK/Rds.go:29 +0xc6
  yw-assist/AliSDK.getRdsInfo()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:28 +0x64
  yw-assist/AliSDK.getRegionInfo.func2()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:185 +0xbb

Goroutine 36 (running) created at:
  yw-assist/AliSDK.getRegionInfo()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:183 +0x211
  yw-assist/AliSDK.getAllRegionInfo()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:216 +0x22b
  yw-assist/AliSDK.cacheAllRegionInfoIntoKvDB()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:304 +0x91
  yw-assist/AliSDK.CacheDBInstanceInfo.func1()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:326 +0x4c

Goroutine 37 (running) created at:
  yw-assist/AliSDK.getRegionInfo()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:183 +0x211
  yw-assist/AliSDK.getAllRegionInfo()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:216 +0x22b
  yw-assist/AliSDK.cacheAllRegionInfoIntoKvDB()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:304 +0x91
  yw-assist/AliSDK.CacheDBInstanceInfo.func1()
      /home/charles/codes/golang/yw-assist/AliSDK/cache.go:326 +0x4c
==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant