swapclientserver: Wait for swapd reconnects - #949
Conversation
There was a problem hiding this comment.
Code Review
This pull request configures the gRPC swap server clients to use the WaitForReady(true) default call option, ensuring they wait through startup connection refusals instead of failing immediately. A new unit test, TestSwapServerClientsWaitForLateGRPCServer, has been added to verify this behavior. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Claude finished @bhandras's task in 1m 58s —— View job PR Review:
|
The swapruntime daemon can build its swapd gRPC channel before swapd is listening. A first swap RPC would then fail from the channel's transient failure state instead of waiting for the listener that started moments later. Set wait-for-ready on the daemon-owned swapd gRPC dial options so swap RPCs wait for the channel to become ready until their caller context expires. Add a regression that starts the client first, starts the fake swap server later, and asserts the first CreateInSwap completes.
3d8790c to
26e880f
Compare
|
@claude thanks, addressed the review feedback and pushed an updated branch. Changes made:
Validation rerun:
Please re-review with this context. |
|
Claude finished @bhandras's task in 1m 3s —— View job Re-review:
|
Summary
Fixes #877.
The swapruntime client daemon can create its daemon-owned gRPC channel to swapd before swapd is listening. If the first swap RPC lands while the channel is still in gRPC's transient failure/backoff state, the call can fail with the stale
connection refusedfrom startup.This PR adds
grpc.WaitForReady(true)as a default call option on the daemon's swapd gRPC dial options. That keeps swapd-bound daemon RPCs waiting for the channel to become ready until the caller context expires, while leaving REST transport and direct SDK-created gRPC clients unchanged.It also adds a regression test that:
CreateInSwap,CreateInSwapcompletes.Validation
go test -tags=swapruntime ./swapclientservermake fmt-changedmake lint-changed-localmake commitmsg-lint range="origin/main..HEAD"