aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-04-11 12:59:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-04-11 12:59:15 +0200
commit4b97dd0e2f192d6999285b83a0ee7260db7cf94f (patch)
tree4a0f66912ba348b6be3ea325693ab4ba50b69df6
parent58f670091484110b807b669421dbc872d214ecf0 (diff)
Fix deadlock in auxiliary machine interrupt logic
-rw-r--r--bbot/agent/agent.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx
index ff380c8..d6a7d4b 100644
--- a/bbot/agent/agent.cxx
+++ b/bbot/agent/agent.cxx
@@ -1984,6 +1984,17 @@ start_auxiliary_machines (const vector<bootstrapped_machine*>& ams,
//
string envs; // Combined environments.
+ auto amg (
+ make_exception_guard (
+ [&amrs] ()
+ {
+ if (!amrs.empty ())
+ {
+ info << "trying to force auxiliary machines down";
+ stop_auxiliary_machines (amrs);
+ }
+ }));
+
for (size_t i (0); i != n; ++i)
{
const auxiliary_machine& tam (tm.auxiliary_machines[i]);
@@ -1996,6 +2007,8 @@ start_auxiliary_machines (const vector<bootstrapped_machine*>& ams,
}));
assert (j != e);
+ // Note: can throw interrupt.
+ //
pair<auxiliary_machine_result, string> p (
start_auxiliary_machine (**j,
tam.environment_name,