-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: gob encoding error not returned in response #7689
Labels
Milestone
Comments
Comment 2 by charlieandrews.cwa: I posted yesterday on the mailing list with a proposed change. https://groups.google.com/forum/#!topic/golang-nuts/AMojGgap0YQ |
Owner changed to @robpike. |
I looked into this briefly. If you buffer the response you end up with an unnecessary second copy in memory. Maybe it's not a big deal, I don't know. At the least perhaps gobServerCodec.WriteResponse should detect the lack of I/O error and do something like print a log message, shut down the connection, or emit a gob value that will cause a decoding error on the other side. if err = c.enc.Encode(r); err != nil { if c.encBuf.Flush() == nil { // was a gob problem, not a write problem. do something } return } if err = c.enc.Encode(body); err != nil { if c.encBuf.Flush() == nil { // was a gob problem, not a write problem. do something } return } return c.encBuf.Flush() Status changed to Accepted. |
CL https://golang.org/cl/146670043 mentions this issue. |
This issue was closed by revision cd5b785. Status changed to Fixed. |
Issue #8173 has been merged into this issue. |
CL https://golang.org/cl/151370043 mentions this issue. |
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
The nicest solution would be to buffer the message and only write it if it encodes correctly, but that adds considerable memory and CPU overhead for a very rare condition. Instead, we just shut down the connection if this happens. Fixes golang#7689. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/146670043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 26, 2018
The nicest solution would be to buffer the message and only write it if it encodes correctly, but that adds considerable memory and CPU overhead for a very rare condition. Instead, we just shut down the connection if this happens. Fixes golang#7689. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/146670043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 9, 2018
The nicest solution would be to buffer the message and only write it if it encodes correctly, but that adds considerable memory and CPU overhead for a very rare condition. Instead, we just shut down the connection if this happens. Fixes golang#7689. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/146670043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 30, 2018
The nicest solution would be to buffer the message and only write it if it encodes correctly, but that adds considerable memory and CPU overhead for a very rare condition. Instead, we just shut down the connection if this happens. Fixes golang#7689. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/146670043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by charlieandrews.cwa:
The text was updated successfully, but these errors were encountered: