From d87ae1c44494700f681d7d50efec8d5500716c33 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 9 Sep 2016 13:22:48 +0200 Subject: manager: fix deadlock This fixes 2 problems: 1. syz-manager inverted condition for local instances. 2. local instances deadlocked on "no output" condition --- vm/vm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vm') diff --git a/vm/vm.go b/vm/vm.go index 25d5010da..ac60c8de0 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -107,10 +107,12 @@ func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput b ) lastExecuteTime := time.Now() ticker := time.NewTimer(3 * time.Minute) + tickerFired := false for { - if !ticker.Stop() { + if !tickerFired && !ticker.Stop() { <-ticker.C } + tickerFired = false ticker.Reset(3 * time.Minute) select { case err := <-errc: @@ -160,6 +162,7 @@ func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput b return "test machine is not executing programs", nil, output, true, false } case <-ticker.C: + tickerFired = true if !local { return "no output from test machine", nil, output, true, false } -- cgit mrf-deployment