From 9cf7201ea33352cb26bc323f9e30611ff61ba2a4 Mon Sep 17 00:00:00 2001 From: Purnesh Dixit Date: Tue, 10 Dec 2024 14:57:42 +0530 Subject: [PATCH 1/3] grpcs: update WithContextDialer documentation to include using passthrough resolver --- dialoptions.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dialoptions.go b/dialoptions.go index 7494ae591f16..8e3aec866782 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -428,6 +428,11 @@ func WithTimeout(d time.Duration) DialOption { // returned by f, gRPC checks the error's Temporary() method to decide if it // should try to reconnect to the network address. // +// If you want to bypass DNS resolution and connect directly to a specified +// address, prefix your target address with passthrough:/// when using +// WithContextDialer. This will cause the passthrough resolver to be used, +// which avoids any DNS lookups. For example: passthrough:///localhost:50051. +// // Note: All supported releases of Go (as of December 2023) override the OS // defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive // with OS defaults for keepalive time and interval, use a net.Dialer that sets From 49aa015a04f42d41df04e62cad1b967cd93726e0 Mon Sep 17 00:00:00 2001 From: Purnesh Dixit Date: Sun, 15 Dec 2024 23:15:31 +0530 Subject: [PATCH 2/3] Update dialoptions.go Co-authored-by: Doug Fawley --- dialoptions.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dialoptions.go b/dialoptions.go index 8e3aec866782..3370f9aca8ba 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -428,10 +428,10 @@ func WithTimeout(d time.Duration) DialOption { // returned by f, gRPC checks the error's Temporary() method to decide if it // should try to reconnect to the network address. // -// If you want to bypass DNS resolution and connect directly to a specified -// address, prefix your target address with passthrough:/// when using -// WithContextDialer. This will cause the passthrough resolver to be used, -// which avoids any DNS lookups. For example: passthrough:///localhost:50051. +// Note that gRPC by default performs name resolution on the target passed to NewClient. +// To bypass name resolution and cause the target string to be passed directly to the dialer +// here instead, use the "passthrough" resolver by specifying it in the target string, +// e.g. "passthrough:target". // // Note: All supported releases of Go (as of December 2023) override the OS // defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive From 91fe06831ec124761dc1b7fb76a005cd24bbe09b Mon Sep 17 00:00:00 2001 From: Purnesh Dixit Date: Sun, 15 Dec 2024 23:18:03 +0530 Subject: [PATCH 3/3] Update dialoptions.go --- dialoptions.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dialoptions.go b/dialoptions.go index 3370f9aca8ba..f3a045296a46 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -428,10 +428,10 @@ func WithTimeout(d time.Duration) DialOption { // returned by f, gRPC checks the error's Temporary() method to decide if it // should try to reconnect to the network address. // -// Note that gRPC by default performs name resolution on the target passed to NewClient. -// To bypass name resolution and cause the target string to be passed directly to the dialer -// here instead, use the "passthrough" resolver by specifying it in the target string, -// e.g. "passthrough:target". +// Note that gRPC by default performs name resolution on the target passed to +// NewClient. To bypass name resolution and cause the target string to be +// passed directly to the dialer here instead, use the "passthrough" resolver +// by specifying it in the target string, e.g. "passthrough:target". // // Note: All supported releases of Go (as of December 2023) override the OS // defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive