mirror of
https://github.com/fullstorydev/grpcurl.git
synced 2026-05-22 19:51:44 +03:00
on error reading request, bidi stream would hang (#63)
This commit is contained in:
@@ -284,6 +284,9 @@ func invokeServerStream(ctx context.Context, stub grpcdynamic.Stub, md *desc.Met
|
|||||||
func invokeBidi(ctx context.Context, stub grpcdynamic.Stub, md *desc.MethodDescriptor, handler InvocationEventHandler,
|
func invokeBidi(ctx context.Context, stub grpcdynamic.Stub, md *desc.MethodDescriptor, handler InvocationEventHandler,
|
||||||
requestData RequestSupplier, req proto.Message) error {
|
requestData RequestSupplier, req proto.Message) error {
|
||||||
|
|
||||||
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
// invoke the RPC!
|
// invoke the RPC!
|
||||||
str, err := stub.InvokeRpcBidiStream(ctx, md)
|
str, err := stub.InvokeRpcBidiStream(ctx, md)
|
||||||
|
|
||||||
@@ -318,6 +321,7 @@ func invokeBidi(ctx context.Context, stub grpcdynamic.Stub, md *desc.MethodDescr
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
sendErr.Store(err)
|
sendErr.Store(err)
|
||||||
|
cancel()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user