From 9bf17eb05a4591d8dec9779a9efddc5c2276699a Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Thu, 13 Aug 2015 15:30:17 +0200 Subject: [PATCH] rpc/comms reconnect ipc client after write error --- rpc/comms/ipc.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rpc/comms/ipc.go b/rpc/comms/ipc.go index e982ada133..d897bf3137 100644 --- a/rpc/comms/ipc.go +++ b/rpc/comms/ipc.go @@ -44,12 +44,14 @@ func (self *ipcClient) Close() { func (self *ipcClient) Send(req interface{}) error { var err error - if err = self.coder.WriteResponse(req); err != nil { - if _, ok := err.(*net.OpError); ok { // connection lost, retry once + if r, ok := req.(*shared.Request); ok { + if err = self.coder.WriteResponse(r); err != nil { if err = self.reconnect(); err == nil { - err = self.coder.WriteResponse(req) + err = self.coder.WriteResponse(r) } } + + return err } return err }