@@ -319,7 +319,7 @@ struct LocalDerivationGoal : DerivationGoal, RestrictionContext
319319 *
320320 * Called by destructor, can't be overridden
321321 */
322- void killChild () override final ;
322+ void killChild ();
323323
324324 /* *
325325 * Kill any processes running under the build user UID or in the
@@ -442,8 +442,6 @@ void LocalDerivationGoal::killChild()
442442
443443 pid.wait ();
444444 }
445-
446- DerivationGoal::killChild ();
447445}
448446
449447
@@ -814,7 +812,6 @@ static std::function<bool(Descriptor, std::string_view)> build_handler(
814812 std::string & currentLogLine,
815813 size_t & currentLogLinePos,
816814 std::list<std::string> & logTail
817-
818815) {
819816 return [&](Descriptor fd, std::string_view data) {
820817 // local & `ssh://`-builds are dealt with here.
@@ -1511,7 +1508,8 @@ Goal::Co LocalDerivationGoal::startBuilder(std::list<std::string> & logTail)
15111508 logTail
15121509 );
15131510
1514- co_await childStarted ({builderOut.get ()}, true , true , std::move (handler));
1511+ bool timedOut = false ;
1512+ co_await childStarted ({builderOut.get ()}, true , true , std::move (handler), timedOut);
15151513
15161514 trace (" calling childStarted build end" );
15171515
@@ -1522,7 +1520,10 @@ Goal::Co LocalDerivationGoal::startBuilder(std::list<std::string> & logTail)
15221520 act->result (resBuildLogLine, currentLogLine);
15231521 }
15241522
1525- if (failed) {
1523+ if (timedOut) {
1524+ killChild ();
1525+ co_return done (BuildResult::TimedOut, {}, std::move (ex));
1526+ } if (failed) {
15261527 killChild ();
15271528 co_return done (
15281529 BuildResult::LogLimitExceeded,
0 commit comments