ensure we close the grpc stream (#1098)

* ensure we close the grpc stream

* use g.Close

* use closed bool flag for checking connection close
This commit is contained in:
Asim Aslam
2020-01-09 17:00:14 +00:00
committed by Vasiliy Tolstov
parent 8c86ad526f
commit 5422d368c0
2 changed files with 13 additions and 2 deletions

View File

@@ -211,6 +211,7 @@ func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client
if opts := g.getGrpcCallOptions(); opts != nil {
grpcCallOptions = append(grpcCallOptions, opts...)
}
st, err := cc.NewStream(ctx, desc, methodToGRPC(req.Service(), req.Endpoint()), grpcCallOptions...)
if err != nil {
return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("Error creating stream: %v", err))