lostluck commented on code in PR #21776:
URL: https://github.com/apache/beam/pull/21776#discussion_r894032839


##########
sdks/go/pkg/beam/core/runtime/harness/harness.go:
##########
@@ -140,6 +118,19 @@ func Main(ctx context.Context, loggingEndpoint, 
controlEndpoint string, options
                state:                &StateChannelManager{},
                cache:                &sideCache,
        }
+
+       // if the runner supports worker status api then expose SDK harness 
status
+       if statusEndpoint != "" {
+               statusHandler, err := newWorkerStatusHandler(ctx, 
statusEndpoint, ctrl.metStore, ctrl.cache)

Review Comment:
   The MetStore requires being locked by ctrl.mu, otherwise we run the risk of 
a race condition. I'd add a method to the control type that produces the 
string, all while locked. The we can call it on demand to avoid this issue.
   
   Note that the statecache doesn't have this issue since it manages it's own 
locking anyway.
   
   ----
   
   We likely want to make a much better "current bundles being processed" 
string from this information, instead of the full state dump. It's not 
particularly readable, there's not enough newlines to break things up, and 
similar.
   
   Good enough for a v0 pass, but we can improve this, either now or later.



-- 
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