m-trieu commented on code in PR #32774:
URL: https://github.com/apache/beam/pull/32774#discussion_r1801332992


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/harness/FanOutStreamingEngineWorkerHarness.java:
##########
@@ -142,16 +142,7 @@ private FanOutStreamingEngineWorkerHarness(
                   connections.get().windmillStreams().values(), 
totalGetWorkBudget);
               lastBudgetRefresh.set(Instant.now());
             });
-    this.getWorkerMetadataStream =
-        Suppliers.memoize(
-            () ->
-                streamFactory.createGetWorkerMetadataStream(
-                    dispatcherClient.getWindmillMetadataServiceStubBlocking(),
-                    getWorkerMetadataThrottleTimer,
-                    endpoints ->
-                        // Run this on a separate thread than the grpc stream 
thread.
-                        newWorkerMetadataPublisher.submit(
-                            () -> newWindmillEndpoints.add(endpoints))));
+    this.getWorkerMetadataStream = null;

Review Comment:
   Don't want to start and do too much (make an RPC call) in the constructor
   
   We also need the metadata stub (dispatcher stub), which we don't have until 
we call start in StreamingDataflowWorker.  Can fix this by making start() be 
asynchronous here but I still think that might be doing too much in the 
constructor.
   
   Will have to suppress a warning (reference to 'this' in constructor) but i 
can create the stream here and just start the stream in start() instead of 
assigning.



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