From d9117ec3a851daeccb10f3529fc13c26a40e9ac3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 27 Mar 2021 10:55:37 +0200 Subject: Abort instead of suspending timed-out interactive builds --- bbot/agent/agent.cxx | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index d85ecf5..ff772bf 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -1007,20 +1007,28 @@ try } } - if (to == 0) - return soft_fail ("build timeout"); - - l3 ([&]{trace << "completed build in " << build_to - to << "s";}); - - // Parse the result manifest. - // - try + if (to != 0) { - r = parse_manifest (rf, "result", false); + l3 ([&]{trace << "completed build in " << build_to - to << "s";}); + + // Parse the result manifest. + // + try + { + r = parse_manifest (rf, "result", false); + } + catch (const failed&) + { + r.status = result_status::abnormal; // Soft-fail below. + } } - catch (const failed&) + else { - r.status = result_status::abnormal; // Soft-fail below. + // Suspend the machine for non-interactive builds and fall through + // to abort for interactive (i.e., "the user went for lunch" case). + // + if (!tm.interactive) + return soft_fail ("build timeout"); } if (r.status == result_status::abnormal) -- cgit v1.1