diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-09 16:37:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-10 15:35:11 +0200 |
commit | 96145726e0fc4060b4ebc86a6a06786aad696e85 (patch) | |
tree | 26708976404a66c419f8fc3e4dcee274fbefe46a /bbot/agent/agent.cxx | |
parent | c63815eb8a8e60ee615182348106a7be1b5e2f18 (diff) |
Don't fail hard if we were unable to suspend machine
Diffstat (limited to 'bbot/agent/agent.cxx')
-rw-r--r-- | bbot/agent/agent.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index 54d7056..3371bf1 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -176,7 +176,7 @@ bootstrap_machine (const dir_path& md, [&m, &md] () { info << "trying to force machine " << md << " down"; - try {m->forcedown ();} catch (const failed&) {} + try {m->forcedown (false);} catch (const failed&) {} })); // What happens if the bootstrap process hangs? The simple thing would @@ -193,9 +193,15 @@ bootstrap_machine (const dir_path& md, dr << msg << " for machine " << md << ", suspending"; m->print_info (dr); } - m->suspend (); - m->wait (); - info << "resuming after machine suspension"; + + try + { + m->suspend (false); + m->wait (false); + info << "resuming after machine suspension"; + } + catch (const failed&) {} + return nullopt; }; @@ -689,7 +695,7 @@ try [&m, &xp] () { info << "trying to force machine " << xp << " down"; - try {m->forcedown ();} catch (const failed&) {} + try {m->forcedown (false);} catch (const failed&) {} })); auto soft_fail = [&xp, &m, &r] (const char* msg) @@ -699,9 +705,15 @@ try dr << msg << " for machine " << xp << ", suspending"; m->print_info (dr); } - m->suspend (); - m->wait (); - info << "resuming after machine suspension"; + + try + { + m->suspend (false); + m->wait (false); + info << "resuming after machine suspension"; + } + catch (const failed&) {} + return r; }; |