Skip to content

rpc/client.go ignores errors from ReadResponseBody #1014

@gopherbot

Description

@gopherbot

by djglowacki:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?

In the input() method in pkg/rpc/client.go, the code around ReadResponseBody looks like:

                err = client.codec.ReadResponseBody(c.Reply)
                // Empty strings should turn into nil os.Errors
                if response.Error != "" {
                        c.Error = os.ErrorString(response.Error)
                } else {
                        c.Error = nil
                }
                // We don't want to block here.  It is the caller's responsibility to make
                // sure the channel has enough buffer space. See comment in Go().
                _ = c.Done <- c // do not block

What is the expected output?

The 'err' value should be handled like the error from ReadResponseHeader a few lines
above:

                err = client.codec.ReadResponseHeader(response)                if err != nil {
                        if err == os.EOF && !client.closing {
                                err = io.ErrUnexpectedEOF
                        }
                        break
                }

What do you see instead?

The 'err' value is thrown away

What is your $GOOS?  $GOARCH?

GOOS=darwin
GOARCH=amd64

Which revision are you using?  (hg identify)

8884f7b4c775 release/release.2010-08-04

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions