Abacn commented on code in PR #39390:
URL: https://github.com/apache/beam/pull/39390#discussion_r3616251833


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/ProcessBundleHandler.java:
##########
@@ -767,6 +767,7 @@ public BeamFnApi.InstructionResponse.Builder 
trySplit(InstructionRequest request
   /** Shutdown the bundles, running the tearDown() functions. */
   public void shutdown() throws Exception {
     bundleProcessorCache.shutdown();
+    beamFnDataClient.close();

Review Comment:
   BeamFnDataGrpcClient is created in FnHarness.main: 
   
   
https://github.com/apache/beam/blob/39c60f087fe74a119823d5133cac8263970c9600/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnHarness.java#L335
   
   and ownership passed to ProcessBundleHandler:
   
   
https://github.com/apache/beam/blob/39c60f087fe74a119823d5133cac8263970c9600/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnHarness.java#L371
   
   Therefore we should close it here.
   
   When FnHarness.main is invoked multiple times (instead of as a standalone 
worker like on Dataflow runner), previously unclosed BeamFnDataGrpcClient leak 
gRPC streams



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