From 16b9c4aa7eec49606d69cf99df18d1fc51468e8f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 21 Mar 2024 20:07:52 +0300 Subject: Minor agent fixes --- bbot/agent/agent.cxx | 18 ++++++++++++------ bbot/agent/tftp.hxx | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index 8316d1c..5278eba 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -260,8 +260,11 @@ bootstrap_build_machine (const dir_path& md, make_exception_guard ( [&m, &md] () { - info << "trying to force machine " << md << " down"; - try {m->forcedown (false);} catch (const failed&) {} + if (m != nullptr) + { + info << "trying to force machine " << md << " down"; + try {m->forcedown (false);} catch (const failed&) {} + } })); // What happens if the bootstrap process hangs? The simple thing would @@ -528,8 +531,11 @@ bootstrap_auxiliary_machine (const dir_path& md, make_exception_guard ( [&m, &md] () { - info << "trying to force machine " << md << " down"; - try {m->forcedown (false);} catch (const failed&) {} + if (m != nullptr) + { + info << "trying to force machine " << md << " down"; + try {m->forcedown (false);} catch (const failed&) {} + } })); auto soft_fail = [&md, &m] (const char* msg) @@ -1420,7 +1426,7 @@ try // See if there is a pending bootstrap and whether we can perform it. // - // What should we do if we can't (i.e., we are in the priority minitor + // What should we do if we can't (i.e., we are in the priority monitor // mode)? Well, we could have found some machines that are already // bootstrapped (busy or not) and there may be a higher-priority task for // one of them, so it feels natural to return whatever we've got. @@ -1925,7 +1931,7 @@ stop_auxiliary_machines (auxiliary_machine_results& amrs) } } } -}; +} // Start all the auxiliary machines and patch in their combined environment // into tm.auxiliary_environment. diff --git a/bbot/agent/tftp.hxx b/bbot/agent/tftp.hxx index 103c9d6..5306dd1 100644 --- a/bbot/agent/tftp.hxx +++ b/bbot/agent/tftp.hxx @@ -29,7 +29,7 @@ namespace bbot port () const; // Wait for a TFTP request for up to the specified number of seconds. If - // increment is not 0, then wait in the specified incremenets (i.e., wait + // increment is not 0, then wait in the specified increments (i.e., wait // for up to that number of seconds; useful when one needs to also // periodically check for something else). Update the timeout value as // well as return true if a request was served and false otherwise. -- cgit v1.1