polarismesh / polaris

Service Discovery and Governance Platform for Microservice and Distributed Architecture
https://polarismesh.cn
Other
2.41k stars 399 forks source link

Panic on plugin/statis/base/cachecall.go #1290

Closed Lin-1997 closed 11 months ago

Lin-1997 commented 1 year ago

Describe the bug

1

Environment

Additional context the (judge exist - set - get) is not atomic in L63-70. The c.statis may be cleared by the func (c *CacheStatics) log() in L109, and resulting in nil pointer dereference of the item in L70

https://github.com/polarismesh/polaris/blob/5f207e2589d06a188cb3d63b6af8f5ad19b706a9/plugin/statis/base/cachecall.go#L61-L77

https://github.com/polarismesh/polaris/blob/5f207e2589d06a188cb3d63b6af8f5ad19b706a9/plugin/statis/base/cachecall.go#L100-L112