diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-04-17 11:56:55 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-04-19 10:26:57 +0200 |
| commit | 1155a0d1d6da810ccd0ef63b79c71b5497dd3dd6 (patch) | |
| tree | 2cd61b31bae6300c62574d472d66a3cf05a37289 | |
| parent | cc8708904da08f9c884253477fc003cc6f6d5945 (diff) | |
sys/linux: sync call timeouts with executor
Timeouts in executor and sys/linux get out of sync. Sync them.
| -rw-r--r-- | executor/executor.cc | 3 | ||||
| -rw-r--r-- | sys/linux/init.go | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index 87f1eaeb6..64d84c394 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -711,7 +711,8 @@ retry: // We already have results from the previous execution. } else if (flag_threaded) { // Wait for call completion. - // Note: sys knows about this 25ms timeout when it generates timespec/timeval values. + // Note: sys/linux knows about this 45 ms timeout when it generates timespec/timeval values. + // Note: pkg/csource also knows about this 45 ms per-call timeout. uint64 timeout_ms = 45 + call->attrs.timeout; if (flag_debug && timeout_ms < 1000) timeout_ms = 1000; diff --git a/sys/linux/init.go b/sys/linux/init.go index c9c15a283..c816bbd28 100644 --- a/sys/linux/init.go +++ b/sys/linux/init.go @@ -283,8 +283,12 @@ func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, old prog.Arg) (a // (2) definitely in unreachable fututre, or // (3) few ms ahead of now. // Note: timespec/timeval can be absolute or relative to now. - // Note: executor has blocking syscall timeout of 20ms, - // so we generate both 10ms and 30ms. + // Note: executor has blocking syscall timeout of 45 ms, + // so we generate both 10ms and 60ms. + const ( + timeout1 = uint64(10) + timeout2 = uint64(60) + ) usec := typ.Name() == "timeval" switch { case g.NOutOf(1, 4): @@ -295,9 +299,9 @@ func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, old prog.Arg) (a }) case g.NOutOf(1, 3): // Few ms ahead for relative, past for absolute - nsec := uint64(10 * 1e6) + nsec := timeout1 * 1e6 if g.NOutOf(1, 2) { - nsec = 30 * 1e6 + nsec = timeout2 * 1e6 } if usec { nsec /= 1e3 @@ -334,9 +338,9 @@ func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, old prog.Arg) (a calls = append(calls, gettime) sec := prog.MakeResultArg(typ.Fields[0], tp.Inner[0].(*prog.ResultArg), 0) nsec := prog.MakeResultArg(typ.Fields[1], tp.Inner[1].(*prog.ResultArg), 0) - msec := uint64(10) + msec := timeout1 if g.NOutOf(1, 2) { - msec = 30 + msec = timeout2 } if usec { nsec.OpDiv = 1e3 |
