on error reading request, bidi stream would hang (#63)
This commit is contained in:
parent
dfa06f4410
commit
0dea37ee70
|
|
@ -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()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue