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: log chatter #3113

Closed
nsf opened this issue Feb 23, 2012 · 2 comments
Closed

net/rpc: log chatter #3113

nsf opened this issue Feb 23, 2012 · 2 comments
Milestone

Comments

@nsf
Copy link

nsf commented Feb 23, 2012

Unfortunately I can't reproduce it in the test app. But I've discovered the bug with
gocode (https://github.com/nsf/gocode). Here's what happens, if you run standalone
'gocode' command all it does is using "net/rpc" package:
1. connect to the server (or run it and connect if it's not running already)
2. disconnect

So.. basically it's `client, err := rpc.Dial(...)` and then `client.Close()`. But
sometimes the net/rpc package prints this nasty log message, here's how it looks like:


[nsf @ gocode]$ gocode
[nsf @ gocode]$ gocode
[nsf @ gocode]$ gocode
2012/02/23 14:33:55 rpc: client protocol error: use of closed network connection
[nsf @ gocode]$ gocode
2012/02/23 14:33:55 rpc: client protocol error: use of closed network connection
[nsf @ gocode]$ gocode
[nsf @ gocode]$ gocode


I did 'hg bisect' on this, the bug appears after this commit:
http://code.google.com/p/go/source/detail?r=a5b623616453

Probably some kind of desync in logic between new "net" principles and the
"net/rpc".

So.. the bug appeared in a5b623616453 commit, between weekly.2012-02-07 and
weekly.2012-02-14.
@rsc
Copy link
Contributor

rsc commented Feb 23, 2012

Comment 1:

I think we should just turn off the print.
The error shows up because one goroutine has called Close
on the network connection while another was blocked in Read,
causing the Read to return 'use of closed network connection'.
It's an expected error.

Labels changed: added priority-go1, removed priority-triage.

Owner changed to builder@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Feb 24, 2012

Comment 2:

This issue was closed by revision 91bdbf5.

Status changed to Fixed.

@nsf nsf added fixed labels Feb 24, 2012
@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants