Repository navigation
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR introduces JobOptions.Dial (DialFunc) to allow callers of runnerlib.Execute to supply and reuse gRPC connections for the job service and artifact staging endpoints without Execute closing them. The implementation is clean, backwards-compatible, and properly preserves the default grpcx.Dial and connection teardown behavior when Dial is nil.
🔍 General Feedback
- The
dialEndpointhelper andstagerefactoring cleanly separate connection ownership between caller-provided and default-dialed connections. - In
execute_test.go,TestExecute_customDialNotClosedcan be improved to exercise the artifact staging dial path (stage) and avoid leaving temporary files inos.TempDir().
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @lostluck for label go. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
fixes #41745
Executealways dials a gRPC connection for the job service and another for artifact staging, then closes both when the job ends. A process that submits many jobs in a row can leave a lot of sockets in TIME_WAIT.JobOptions.Diallets the caller provide those connections.Executedoes not close whatDialreturns.Dialis called once per endpoint (job and artifact may differ). IfDialis nil,Executestill dials withgrpcx.Dialand closes as before.The exported
Stageis unchanged: it still dials and closes.No breaking change:
Dialis a new field onJobOptions, zero value is nil.Example