aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-06 17:39:19 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-01-06 17:39:19 +0100
commitbb0359b914863d1c662a775b4159834e0fa697ce (patch)
tree330879dcc21d9a5a9716843c5ba20daef8b097ab /pkg
parent7a2f0c79279d74bb8e8b1c85e68dea0dc206abc8 (diff)
pkg/ipc: always prepend handshake errors with executor pid
Helps to understand what program caused it.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ipc/ipc.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go
index 5b716b6e7..fbce12efa 100644
--- a/pkg/ipc/ipc.go
+++ b/pkg/ipc/ipc.go
@@ -672,8 +672,7 @@ func (c *command) handshake() error {
}
reqData := (*[unsafe.Sizeof(*req)]byte)(unsafe.Pointer(req))[:]
if _, err := c.outwp.Write(reqData); err != nil {
- return c.handshakeError(fmt.Errorf("executor %v: failed to write control pipe: %v",
- c.pid, err))
+ return c.handshakeError(fmt.Errorf("failed to write control pipe: %v", err))
}
read := make(chan error, 1)
@@ -685,8 +684,7 @@ func (c *command) handshake() error {
return
}
if reply.magic != outMagic {
- read <- fmt.Errorf("executor %v: bad handshake reply magic 0x%x",
- c.pid, reply.magic)
+ read <- fmt.Errorf("bad handshake reply magic 0x%x", reply.magic)
return
}
read <- nil
@@ -700,14 +698,14 @@ func (c *command) handshake() error {
}
return nil
case <-timeout.C:
- return c.handshakeError(fmt.Errorf("executor %v: not serving", c.pid))
+ return c.handshakeError(fmt.Errorf("not serving"))
}
}
func (c *command) handshakeError(err error) error {
c.abort()
output := <-c.readDone
- err = fmt.Errorf("%v\n%s", err, output)
+ err = fmt.Errorf("executor %v: %v\n%s", c.pid, err, output)
c.wait()
if c.cmd.ProcessState != nil {
// Magic values returned by executor.