]> Cypherpunks repositories - gostls13.git/commit
net/rpc: fix race condition when request write partially fails
authorAlexey Borzenkov <snaury@gmail.com>
Thu, 24 May 2012 23:07:08 +0000 (16:07 -0700)
committerRob Pike <r@golang.org>
Thu, 24 May 2012 23:07:08 +0000 (16:07 -0700)
commit161f50574a9a17e43f4fad88dae57201b5bc3af8
tree41a7998c442c566770de9deb15ce59b81089d1b1
parent68f42ea27eb7c399e8577d4b5f999cec4ac59e20
net/rpc: fix race condition when request write partially fails

When client fails to write a request is sends caller that error,
however server might have failed to read that request in the mean
time and replied with that error. When client then reads the
response the call would no longer be pending, so call will be nil

Handle this gracefully by discarding such server responses

R=golang-dev, r
CC=golang-dev, rsc
https://golang.org/cl/5956051
src/pkg/net/rpc/client.go