grpc-go
grpc-go copied to clipboard
grpc: protect field access with lock to avoid potential data race
It seems to be a potential data race. Specifically, there are two confilicting operations on the field "Addresses", where the read operation is protected by a lock at: grpc/pickfirst.go:90, and the write operation is unprotectd by the lock at:grpc/resolver_conn_wrapper.go:126. A data race may occurs when the two functions where the two operations are located.
We need more information to proceed, here.
- What version of the code are you looking at? master@HEAD doesn't have any relevant code on those lines.
- How did you discover the problem? Is this code inspection and speculation?
- Do you have a proposed fix?
This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.
- may be the v1.50.0;
- code analysis;
- adding a lock to the unprotected operation.
I don't see any issue here. If you can be much more specific, and ideally reference master@HEAD or something more recent, then we could investigate further.