Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/rpc: server.go io.EOF error condition need errors.Is function #43964

Closed
lhcGinv opened this issue Jan 28, 2021 · 1 comment
Closed

net/rpc: server.go io.EOF error condition need errors.Is function #43964

lhcGinv opened this issue Jan 28, 2021 · 1 comment
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@lhcGinv
Copy link

lhcGinv commented Jan 28, 2021

go version

v1.15.7

error

readRequestHeader method return a error like this:

if err == io.EOF || err == io.ErrUnexpectedEOF {
    err = fmt.Errorf("rpc: header unexpected eof %w", err)
    return
}

but ServeCodec method just use condition err != io.EOF

expect

false == errors.Is(err, io.EOF)

@lhcGinv lhcGinv changed the title net/rpc io.EOF error condition need errors.Is function net/rpc server.go io.EOF error condition need errors.Is function Jan 28, 2021
@ianlancetaylor
Copy link
Contributor

I don't understand. I don't see any code like

err = fmt.Errorf("rpc: header unexpected eof %w", err)

in the net/rpc package. Can you point to the exact line at https://golang.org/src/net/rpc/server.go ? Thanks.

@ianlancetaylor ianlancetaylor added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 28, 2021
@ianlancetaylor ianlancetaylor changed the title net/rpc server.go io.EOF error condition need errors.Is function net/rpc: server.go io.EOF error condition need errors.Is function Jan 28, 2021
@lhcGinv lhcGinv closed this as completed Jan 28, 2021
@golang golang locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants