From 4049a84f7c1d314766e042f3f4fa0cc719f79065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Thu, 4 Apr 2024 21:27:24 +0200 Subject: [PATCH 1/3] grpc: Deprecate WithBlock, WithReturnConnectionError, FailOnNonTempDialError --- clientconn.go | 5 +++-- dialoptions.go | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/clientconn.go b/clientconn.go index e3eb44d58b70..2931fda33761 100644 --- a/clientconn.go +++ b/clientconn.go @@ -121,8 +121,9 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires // https://github.com/grpc/grpc/blob/master/doc/naming.md. e.g. to use dns // resolver, a "dns:///" prefix should be applied to the target. // -// The DialOptions returned by WithBlock, WithTimeout, and -// WithReturnConnectionError are ignored by this function. +// The DialOptions returned by WithBlock, WithTimeout, +// WithReturnConnectionError, and FailOnNonTempDialError are ignored by this +// function. func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) { cc := &ClientConn{ target: target, diff --git a/dialoptions.go b/dialoptions.go index e4a985f45848..fde50745081e 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -300,6 +300,9 @@ func withBackoff(bs internalbackoff.Strategy) DialOption { // // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md +// +// Deprecated: this DialOption is not supported by NewClient. +// Will be supported throughout 1.x. func WithBlock() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true @@ -318,6 +321,8 @@ func WithBlock() DialOption { // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. +// +// Deprecated: this DialOption is not supported by NewClient. func WithReturnConnectionError() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true @@ -387,8 +392,8 @@ func WithCredentialsBundle(b credentials.Bundle) DialOption { // WithTimeout returns a DialOption that configures a timeout for dialing a // ClientConn initially. This is valid if and only if WithBlock() is present. // -// Deprecated: use DialContext instead of Dial and context.WithTimeout -// instead. Will be supported throughout 1.x. +// Deprecated: this DialOption is not supported by NewClient. +// Will be supported throughout 1.x. func WithTimeout(d time.Duration) DialOption { return newFuncDialOption(func(o *dialOptions) { o.timeout = d @@ -474,6 +479,8 @@ func withBinaryLogger(bl binarylog.Logger) DialOption { // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. +// +// Deprecated: this DialOption is not supported by NewClient. func FailOnNonTempDialError(f bool) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.FailOnNonTempDialError = f From cce30008634fa201fb6d8500b9c12f6b3c806d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 5 Apr 2024 19:19:38 +0200 Subject: [PATCH 2/3] Update dialoptions.go --- dialoptions.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dialoptions.go b/dialoptions.go index fde50745081e..0001f55fb0e6 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -317,12 +317,8 @@ func WithBlock() DialOption { // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -// // Deprecated: this DialOption is not supported by NewClient. +// Will be supported throughout 1.x. func WithReturnConnectionError() DialOption { return newFuncDialOption(func(o *dialOptions) { o.block = true From cbdf3519fb67fb293b164642a2068b1502ca0451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 5 Apr 2024 19:21:52 +0200 Subject: [PATCH 3/3] Update dialoptions.go --- dialoptions.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dialoptions.go b/dialoptions.go index 0001f55fb0e6..665040561ee2 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -471,12 +471,9 @@ func withBinaryLogger(bl binarylog.Logger) DialOption { // Use of this feature is not recommended. For more information, please see: // https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md // -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -// // Deprecated: this DialOption is not supported by NewClient. +// This API may be changed or removed in a +// later release. func FailOnNonTempDialError(f bool) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.FailOnNonTempDialError = f