Whatever in client side or server side, you could call 'CloseSend' then cancel the context in grpc-go as a normal termination or cancel the context without calling 'CloseSend' as an error abort. But on the another side, it's difficult to clear what actual error causing this abort.
在2018年2月13日星期二 UTC+8 22:05:50<Glyn Normington> 写道: > I'm trying to decide how to handle stream errors correctly, both in the > client and in the server. My working assumption, in Go, is that io.EOF > indicates > a normal termination and that all other errors are abnormal and permanent, > but I'd like to check that assumption. > > It would be great to know which gRPC errors are permanent and which, if > any, are transient. The Go Stream > <https://godoc.org/google.golang.org/grpc#Stream> interface talks about > streams being "done" or "aborted" (both of which sound like permanent > states), but without defining these terms further. > > The available example code isn't particularly useful as it's not clear > which parts are normative. > > The gRPC documentation has a section on error handling > <https://grpc.io/docs/guides/error.html>, but this doesn't describe which > errors are permanent and which are transient. It's not even clear how the > status codes described map to language-specific error values. For instance, > which value(s) corresponds to io.EOF (surely a permanent error!) in Go? > > Please could someone offer some definitive information? > > Regards, > Glyn > > > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/799653a3-5894-469f-8d47-ffc1a23509efn%40googlegroups.com.
