joellubi commented on code in PR #38385:
URL: https://github.com/apache/arrow/pull/38385#discussion_r1558120008
##########
go/arrow/flight/record_batch_writer.go:
##########
@@ -47,7 +53,16 @@ func (f *flightPayloadWriter) WritePayload(payload
ipc.Payload) error {
payload.SerializeBody(&f.buf)
f.fd.DataBody = f.buf.Bytes()
- return f.w.Send(&f.fd)
+ err := f.w.Send(&f.fd)
+ if err == io.EOF {
+ // gRPC returns io.EOF if the error was generated by the server.
+ // We return a more informative error to clients that hides
this gRPC idiosyncrasy.
+ // The error can be retrieved subsequently by calling RecvMsg
on the stream
+ // ref: https://pkg.go.dev/google.golang.org/grpc#ClientStream
+ return ErrDataStreamClosed
+ }
Review Comment:
Perhaps not... This is a good point about being a breaking change.
Returning `io.EOF` on `Write` makes for a pretty confusing API IMO, but I
suppose we're stuck with it. I'll revert this and just leave the comment in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]