igor-dv commented on code in PR #41744:
URL: https://github.com/apache/beam/pull/41744#discussion_r4744769511
##########
sdks/go/pkg/beam/runners/universal/runnerlib/job.go:
##########
@@ -50,6 +53,33 @@ type JobOptions struct {
// Loopback indicates this job is running in loopback mode and will
reconnect to the local process.
Loopback bool
+
+ // Dial, if set, opens connections to the job service and artifact
+ // staging endpoint. Execute does not close what Dial returns; the
+ // caller owns the connection. Dial is invoked once per endpoint
+ // (job and artifact may differ). Returning a new connection each
+ // call leaks those connections. If nil, Execute uses grpcx.Dial
+ // and closes the connection when done.
+ Dial DialFunc
Review Comment:
For the context: I'm writing a custom runner that runs on long-lived k8s
nodes. We submit a lot of jobs from the same process, and Execute dials the job
service and when job ends it closes it. That leaves sockets in TIME_WAIT and we
hit port exhaustion. There's no reason for a new connection per job in this
setup, so I wanted to keep using runnerlib and just override the dial.
Regarding your question, it's only for the process that calls
runnerlib.Execute. It's a function on a local struct, so it isn't sent to
workers and doesn't go through beam.Init. beam.Run with in-process Prism
doesn't set Dial.
--
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]