Skip to content

Commit 59be823

Browse files
authored
grpc: Deprecate WithBlock, WithReturnConnectionError, FailOnNonTempDialError (#7097)
1 parent c31cec3 commit 59be823

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

clientconn.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires
121121
// https://github.com/grpc/grpc/blob/master/doc/naming.md. e.g. to use dns
122122
// resolver, a "dns:///" prefix should be applied to the target.
123123
//
124-
// The DialOptions returned by WithBlock, WithTimeout, and
125-
// WithReturnConnectionError are ignored by this function.
124+
// The DialOptions returned by WithBlock, WithTimeout,
125+
// WithReturnConnectionError, and FailOnNonTempDialError are ignored by this
126+
// function.
126127
func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) {
127128
cc := &ClientConn{
128129
target: target,

dialoptions.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ func withBackoff(bs internalbackoff.Strategy) DialOption {
300300
//
301301
// Use of this feature is not recommended. For more information, please see:
302302
// https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md
303+
//
304+
// Deprecated: this DialOption is not supported by NewClient.
305+
// Will be supported throughout 1.x.
303306
func WithBlock() DialOption {
304307
return newFuncDialOption(func(o *dialOptions) {
305308
o.block = true
@@ -314,10 +317,8 @@ func WithBlock() DialOption {
314317
// Use of this feature is not recommended. For more information, please see:
315318
// https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md
316319
//
317-
// # Experimental
318-
//
319-
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
320-
// later release.
320+
// Deprecated: this DialOption is not supported by NewClient.
321+
// Will be supported throughout 1.x.
321322
func WithReturnConnectionError() DialOption {
322323
return newFuncDialOption(func(o *dialOptions) {
323324
o.block = true
@@ -387,8 +388,8 @@ func WithCredentialsBundle(b credentials.Bundle) DialOption {
387388
// WithTimeout returns a DialOption that configures a timeout for dialing a
388389
// ClientConn initially. This is valid if and only if WithBlock() is present.
389390
//
390-
// Deprecated: use DialContext instead of Dial and context.WithTimeout
391-
// instead. Will be supported throughout 1.x.
391+
// Deprecated: this DialOption is not supported by NewClient.
392+
// Will be supported throughout 1.x.
392393
func WithTimeout(d time.Duration) DialOption {
393394
return newFuncDialOption(func(o *dialOptions) {
394395
o.timeout = d
@@ -470,9 +471,8 @@ func withBinaryLogger(bl binarylog.Logger) DialOption {
470471
// Use of this feature is not recommended. For more information, please see:
471472
// https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md
472473
//
473-
// # Experimental
474-
//
475-
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
474+
// Deprecated: this DialOption is not supported by NewClient.
475+
// This API may be changed or removed in a
476476
// later release.
477477
func FailOnNonTempDialError(f bool) DialOption {
478478
return newFuncDialOption(func(o *dialOptions) {

0 commit comments

Comments
 (0)