diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-09 16:37:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-09 16:37:31 +0200 |
commit | f76bc9bf7f2b9378102d0d34b12987170b5ae3ef (patch) | |
tree | 20e09e59c1fc0c5317337409d3e81a9eba315dbf /bbot/agent/agent.cxx | |
parent | 355fb2bf20af05ccd885279db26f9ccce669dd13 (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 59ffa03..dac70ee 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; }; |