This commit is contained in:
iamqizhao 2016-07-15 11:02:03 -07:00
parent 69e799fc76
commit ec7eacfcc4
2 changed files with 2 additions and 4 deletions

View File

@ -190,9 +190,7 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
case <-t.Error():
// Incur transport error, simply exit.
case <-s.Done():
err := Errorf(s.StatusCode(), s.StatusDesc())
cs.finish(err)
cs.closeTransportStream(err)
// Simply exit. Leave the next I/O op to do cleanup.
case <-s.Context().Done():
err := s.Context().Err()
cs.finish(err)

View File

@ -1536,7 +1536,7 @@ func testClientStreamingError(t *testing.T, e env) {
t.Fatalf("%v.Send(%v) = %v, want <nil>", stream, req, err)
}
for {
if err := stream.Send(req); err == nil {
if err := stream.Send(req); err != io.EOF {
continue
}
if _, err := stream.CloseAndRecv(); grpc.Code(err) != codes.NotFound {