[
https://issues.apache.org/jira/browse/BEAM-12979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jack McCluskey updated BEAM-12979:
----------------------------------
Fix Version/s: 2.34.0
Resolution: Fixed
Status: Resolved (was: Triage Needed)
> [Go SDK] Avoid shallow copying CacheToken protobufs in statecache.go
> --------------------------------------------------------------------
>
> Key: BEAM-12979
> URL: https://issues.apache.org/jira/browse/BEAM-12979
> Project: Beam
> Issue Type: Bug
> Components: sdk-go
> Reporter: Daniel Oliveira
> Assignee: Jack McCluskey
> Priority: P2
> Fix For: 2.34.0
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> Copying protobuf messages should be avoided because it causes a ton of subtle
> bugs, especially when mutexes inside the object get copied. We should be
> using pointers instead.
> Some spots where copies of CacheTokens are made instead of pointers:
> [https://github.com/apache/beam/blob/f051cd91d46e5dab0ca48f108b27d9d87e6e5e8f/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache.go#L92]
> [https://github.com/apache/beam/blob/f051cd91d46e5dab0ca48f108b27d9d87e6e5e8f/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache.go#L124]
> [https://github.com/apache/beam/blob/f051cd91d46e5dab0ca48f108b27d9d87e6e5e8f/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache_test.go#L119]
> This isn't an exhaustive list, but it covers some of the major instances.
> Should be easy enough to ctrl+f "fnpb.ProcessBundleRequest_CacheToken" and
> just make sure it's used as a pointer wherever possible.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)