aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ipc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-12-22 12:01:52 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-12-25 10:12:41 +0100
commitf8f67d67d3daa783c2bb7c9993c0ccb637af1a0e (patch)
treed17cd1f31315f1466673d951dad6ee9e309d66ec /pkg/ipc
parent549d0d03df068e7cc1d48f92ba1ba76153c91339 (diff)
executor: remove hardcoded timeouts
In preparation for making timeouts tunable based on OS/arch/VM/etc de-hardcode all (almost) timeouts in executor.
Diffstat (limited to 'pkg/ipc')
-rw-r--r--pkg/ipc/ipc.go34
1 files changed, 20 insertions, 14 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go
index cb6dcd8e9..0f1bd50a6 100644
--- a/pkg/ipc/ipc.go
+++ b/pkg/ipc/ipc.go
@@ -500,13 +500,16 @@ type handshakeReply struct {
}
type executeReq struct {
- magic uint64
- envFlags uint64 // env flags
- execFlags uint64 // exec flags
- pid uint64
- faultCall uint64
- faultNth uint64
- progSize uint64
+ magic uint64
+ envFlags uint64 // env flags
+ execFlags uint64 // exec flags
+ pid uint64
+ faultCall uint64
+ faultNth uint64
+ syscallTimeoutMS uint64
+ programTimeoutMS uint64
+ slowdownScale uint64
+ progSize uint64
// This structure is followed by a serialized test program in encodingexec format.
// Both when sent over a pipe or in shared memory.
}
@@ -722,13 +725,16 @@ func (c *command) wait() error {
func (c *command) exec(opts *ExecOpts, progData []byte) (output []byte, hanged bool, err0 error) {
req := &executeReq{
- magic: inMagic,
- envFlags: uint64(c.config.Flags),
- execFlags: uint64(opts.Flags),
- pid: uint64(c.pid),
- faultCall: uint64(opts.FaultCall),
- faultNth: uint64(opts.FaultNth),
- progSize: uint64(len(progData)),
+ magic: inMagic,
+ envFlags: uint64(c.config.Flags),
+ execFlags: uint64(opts.Flags),
+ pid: uint64(c.pid),
+ faultCall: uint64(opts.FaultCall),
+ faultNth: uint64(opts.FaultNth),
+ syscallTimeoutMS: 50,
+ programTimeoutMS: 5000,
+ slowdownScale: 1,
+ progSize: uint64(len(progData)),
}
reqData := (*[unsafe.Sizeof(*req)]byte)(unsafe.Pointer(req))[:]
if _, err := c.outwp.Write(reqData); err != nil {