@ -46,9 +46,9 @@ import (
|
|||||||
var (
|
var (
|
||||||
// ErrUnspecTarget indicates that the target address is unspecified.
|
// ErrUnspecTarget indicates that the target address is unspecified.
|
||||||
ErrUnspecTarget = errors.New("grpc: target is unspecified")
|
ErrUnspecTarget = errors.New("grpc: target is unspecified")
|
||||||
// ErrClosingConn indicates that the operation is illegal because the session
|
// ErrClientConnClosing indicates that the operation is illegal because
|
||||||
// is closing.
|
// the session is closing.
|
||||||
ErrClosingConn = errors.New("grpc: the client connection is closing")
|
ErrClientConnClosing = errors.New("grpc: the client connection is closing")
|
||||||
)
|
)
|
||||||
|
|
||||||
type dialOptions struct {
|
type dialOptions struct {
|
||||||
@ -126,7 +126,7 @@ func (cc *ClientConn) resetTransport(closeTransport bool) error {
|
|||||||
cc.transportSeq = 0
|
cc.transportSeq = 0
|
||||||
if cc.closing {
|
if cc.closing {
|
||||||
cc.mu.Unlock()
|
cc.mu.Unlock()
|
||||||
return ErrClosingConn
|
return ErrClientConnClosing
|
||||||
}
|
}
|
||||||
cc.mu.Unlock()
|
cc.mu.Unlock()
|
||||||
if closeTransport {
|
if closeTransport {
|
||||||
@ -180,7 +180,7 @@ func (cc *ClientConn) wait(ctx context.Context, ts int) (transport.ClientTranspo
|
|||||||
switch {
|
switch {
|
||||||
case cc.closing:
|
case cc.closing:
|
||||||
cc.mu.Unlock()
|
cc.mu.Unlock()
|
||||||
return nil, 0, ErrClosingConn
|
return nil, 0, ErrClientConnClosing
|
||||||
case ts < cc.transportSeq:
|
case ts < cc.transportSeq:
|
||||||
// Worked on a dying transport. Try the new one immediately.
|
// Worked on a dying transport. Try the new one immediately.
|
||||||
defer cc.mu.Unlock()
|
defer cc.mu.Unlock()
|
||||||
|
Reference in New Issue
Block a user