Skip to content

Commit f9df299

Browse files
committed
rpc: fix DialRPC when NoLoopbackDialer is true
If NoLoopbackDialer is true, then loopbackDRPCDialFn would return the error "loopback dialer called but NoLoopbackDialer was set". This was causing problem with sysbench benchmarks. Fixes: none Epic: none Release note: none
1 parent 21b75ac commit f9df299

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/rpc/drpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func DialDRPC(
5555
_ struct{}) (drpcpool.Conn, error) {
5656

5757
netConn, err := func(ctx context.Context) (net.Conn, error) {
58-
if rpcCtx.ContextOptions.AdvertiseAddr == target && !rpcCtx.ClientOnly {
58+
if rpcCtx.ContextOptions.AdvertiseAddr == target && rpcCtx.canLoopbackDial() {
5959
return rpcCtx.loopbackDRPCDialFn(ctx)
6060
}
6161
return drpcmigrate.DialWithHeader(ctx, "tcp", target, drpcmigrate.DRPCHeader)

0 commit comments

Comments
 (0)