Skip to content

Commit 3b8f349

Browse files
author
liangzhiyang
committed
增加说明
1 parent 1ae4768 commit 3b8f349

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ recvResponse()
4949

5050
[grpc服务异常情况的执行流程](http://blog.csdn.net/liangzhiyang/article/details/61921843)
5151

52+
[grpc的invoke(一次请求)正常执行流程](http://blog.csdn.net/liangzhiyang/article/details/62230971)

Diff for: clientconn.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ var (
7575
// errConnDrain indicates that the connection starts to be drained and does not accept any new RPCs.
7676
errConnDrain = errors.New("grpc: the connection is drained")
7777
// errConnClosing indicates that the connection is closing.
78+
// 这个表示连接被关闭了,一般是balancer中去掉之后,被teardown了
7879
errConnClosing = errors.New("grpc: the connection is closing")
7980
// errConnUnavailable indicates that the connection is unavailable.
81+
//这个表示连接是无效的,一般是服务有问题,但是没有从balancer中去掉,这个时候会一直重试连接
8082
errConnUnavailable = errors.New("grpc: the connection is unavailable")
8183
errNoAddr = errors.New("grpc: there is no address available to dial")
8284
// minimum time to give a connection to complete
@@ -657,7 +659,7 @@ func (cc *ClientConn) getTransport(ctx context.Context, opts BalancerGetOptions)
657659
}
658660
return nil, nil, errConnClosing
659661
}
660-
//等待一个连接,默认情况下,不保证连接ok
662+
//等待一个连接,默认情况下,这里是保证连接ok,如果不ok会返回错误
661663
t, err := ac.wait(ctx, cc.dopts.balancer != nil, !opts.BlockingWait)
662664
if err != nil {
663665
if put != nil {

0 commit comments

Comments
 (0)