We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc22f4e commit 325cf76Copy full SHA for 325cf76
codec/rpc.go
@@ -162,7 +162,13 @@ func (c *goRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error {
162
}
163
164
func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error {
165
- return c.write(r, body, true)
+ err := c.write(r, body, true)
166
+ if err != nil {
167
+ // If error occurred writing a response, close the underlying connection.
168
+ // See hashicorp/net-rpc-msgpackrpc#15
169
+ c.Close()
170
+ }
171
+ return err
172
173
174
func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error {
0 commit comments