shunping opened a new pull request, #39663:
URL: https://github.com/apache/beam/pull/39663

   ### Description
   #### Problem
   When running Portable/YAML pipelines, gRPC outputs severe error logs 
indicating that ManagedChannel instances were garbage collected without being 
shut down:
   
   ```
   SEVERE: *~*~*~ Previous channel ManagedChannelImpl{logId=..., target=...} 
was garbage collected without being shut down! ~*~*~*
       Make sure to call shutdown()/shutdownNow()
   java.lang.Throwable: java.lang.RuntimeException: ManagedChannel allocation 
site
       at 
org.apache.beam.vendor.grpc.v1p69p0.io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(...)
   ```
   
   #### Cause
   Three places in the Java Fn Harness allocated gRPC ManagedChannel instances 
without shutting them down upon task completion or harness shutdown:
   
   - ExternalWorkerService: A ManagedChannel was created to query the provision 
service for worker options, but was left unclosed after obtaining provisionInfo.
   - BeamFnDataGrpcClient & BeamFnDataGrpcMultiplexer: BeamFnDataGrpcClient 
created a ManagedChannel per BeamFnDataGrpcMultiplexer, but neither stored nor 
shut down the channel when close() was called.
   - FnHarness: The control service ManagedChannel was created during harness 
startup but was never shut down when FnHarness.main() finished.


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