[ 
https://issues.apache.org/jira/browse/ARROW-14769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated ARROW-14769:
-----------------------------------
    Labels: pull-request-available  (was: )

> [Go] Errors from MessageReader.Message don't get surfaced by Reader.Read
> ------------------------------------------------------------------------
>
>                 Key: ARROW-14769
>                 URL: https://issues.apache.org/jira/browse/ARROW-14769
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Go
>            Reporter: David Li
>            Assignee: David Li
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Noticed while playing with a Flight client. This snippet inadvertently 
> suppresses all errors that come from the underlying MessageReader since 
> {{next}} sets {{done}} after an error is encountered.
> {code:go}
> func (r *Reader) Read() (array.Record, error) {
>       if r.rec != nil {
>               r.rec.Release()
>               r.rec = nil
>       }
>       if !r.next() {
>                 // r.done is set if next() errors, so we always
>                 // return EOF instead of the actual error
>               if r.done {
>                       return nil, io.EOF
>               }
>               return nil, r.err
>       }
>       return r.rec, nil
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to