From 4d9fa979f81bd875c57eb8726a99ecba4a1f08bc Mon Sep 17 00:00:00 2001 From: thecoblack Date: Fri, 29 Jul 2022 17:48:55 +0200 Subject: [PATCH] Fix LocalShellCommand::checkCall() does not kill process on timeout. --- compiler_gym/util/Subprocess.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler_gym/util/Subprocess.cc b/compiler_gym/util/Subprocess.cc index 3e9fcf404..4979bc634 100644 --- a/compiler_gym/util/Subprocess.cc +++ b/compiler_gym/util/Subprocess.cc @@ -60,6 +60,7 @@ Status LocalShellCommand::checkCall() const { bp::child process(arguments(), bp::std_out > bp::null, bp::std_err > stderrFuture, bp::shell, stderrStream, env()); if (!wait_for(process, timeout())) { + process.terminate(); return Status(StatusCode::DEADLINE_EXCEEDED, fmt::format("Command '{}' failed to complete within {} seconds", commandline(), timeoutSeconds()));