From f8f67d67d3daa783c2bb7c9993c0ccb637af1a0e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 22 Dec 2020 12:01:52 +0100 Subject: executor: remove hardcoded timeouts In preparation for making timeouts tunable based on OS/arch/VM/etc de-hardcode all (almost) timeouts in executor. --- pkg/ipc/ipc.go | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'pkg/ipc') 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 { -- cgit mrf-deployment