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

spanner: do not copy protobuf messages by value. #2581

Merged
merged 2 commits into from Jul 10, 2020

Conversation

hengfengli
Copy link
Contributor

We should not copy protobuf messages by value, which contains a sync.Mutex.

Warnings:

assignment copies lock value to req: google.golang.org/genproto/googleapis/spanner/v1.ReadRequest contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutexcopylocks

assignment copies lock value to req: google.golang.org/genproto/googleapis/spanner/v1.ExecuteSqlRequest contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutexcopylocks

Fixes #2397

@hengfengli hengfengli added the api: spanner Issues related to the Spanner API. label Jul 10, 2020
@hengfengli hengfengli self-assigned this Jul 10, 2020
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 10, 2020
Copy link
Contributor

@skuruppu skuruppu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the quick fix.

@hengfengli hengfengli merged commit d519cb8 into googleapis:master Jul 10, 2020
@hengfengli hengfengli deleted the fix-copy-protobuf-by-value branch July 10, 2020 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner: batch.go shouldn't copy protobuf by value
3 participants