damccorm commented on a change in pull request #16980:
URL: https://github.com/apache/beam/pull/16980#discussion_r820781403
##########
File path: sdks/go/pkg/beam/core/runtime/harness/harness.go
##########
@@ -506,6 +563,12 @@ func (c *control) handleInstruction(ctx context.Context,
req *fnpb.InstructionRe
func (c *control) getPlanOrResponse(ctx context.Context, kind string, instID,
ref instructionID) (*exec.Plan, *metrics.Store, *fnpb.InstructionResponse) {
c.mu.Lock()
plan, ok := c.active[ref]
+ if !ok {
+ awaitingFinalization, ok := c.awaitingFinalization[ref]
Review comment:
Oh interesting - that makes sense, scoping is kinda weird in this
situation.
Rather than using ok2, I think I prefer just not doing any initialization
statements and updating to:
```
var af awaitingFinalization
af, ok = c.awaitingFinalization[ref]
if ok {
plan = af.plan
}
```
--
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]