riteshghorse commented on a change in pull request #15657:
URL: https://github.com/apache/beam/pull/15657#discussion_r738491007



##########
File path: sdks/go/pkg/beam/core/metrics/metrics.go
##########
@@ -136,6 +136,10 @@ func SetPTransformID(ctx context.Context, id string) 
context.Context {
        // Checking for *beamCtx is an optimization, so we don't dig deeply
        // for ids if not necessary.
        if bctx, ok := ctx.(*beamCtx); ok {
+               if _, ok := bctx.store.stateRegistry[id]; !ok {
+                       bctx.store.stateRegistry[id] = 
[4]*ExecutionState{&ExecutionState{}, &ExecutionState{}, &ExecutionState{}, 
&ExecutionState{}}

Review comment:
       Other function will make a copy of it and the original registry won't 
store the written values.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to