From d2155c44880a56c13ce79f4ad9af47bfc6864ce6 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 22 Mar 2012 19:00:37 +0000 Subject: [PATCH] - VBOX: Do not treat the timeout error as a fatal error when attempting to delete stale snapshots. Slower machines can take longer than 45 seconds to complete the deletion of old snapshots. samples/vboxwrapper/ vbox.cpp svn path=/trunk/boinc/; revision=25474 --- checkin_notes | 8 ++++++++ samples/vboxwrapper/vbox.cpp | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/checkin_notes b/checkin_notes index e845440d4d..a6f5240ec4 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2954,3 +2954,11 @@ Rom 22 Mar 2012 samples/vboxwrapper/ vbox.cpp vboxwrapper.cpp + +Rom 22 Mar 2012 + - VBOX: Do not treat the timeout error as a fatal error when attempting + to delete stale snapshots. Slower machines can take longer than + 45 seconds to complete the deletion of old snapshots. + + samples/vboxwrapper/ + vbox.cpp diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index 3b09991933..645c2dc90c 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -420,8 +420,10 @@ int VBOX_VM::createsnapshot(double elapsed_time, double checkpoint_cpu_time) { command = "snapshot \"" + vm_name + "\" "; command += "delete boinc_"; command += buf; - retval = vbm_popen(command, output, "delete stale snapshot"); - if (retval) return retval; + retval = vbm_popen(command, output, "delete stale snapshot", true, false); + if (retval) { + if (retval != ERR_TIMEOUT) return retval; + } } fprintf( @@ -1663,13 +1665,9 @@ int VBOX_VM::vbm_popen_raw(string& arguments, string& output) { // Timeout? if (ulExitTimeout >= 45000) { - fprintf( - stderr, - "%s Process Timeout!.\n", - vboxwrapper_msg_prefix(buf, sizeof(buf)) - ); - TerminateProcess(pi.hProcess, EXIT_FAILURE); + ulExitCode = 0; + retval = ERR_TIMEOUT; Sleep(1000); } @@ -1697,6 +1695,7 @@ CLEANUP: // If something couldn't be found, just return ERR_FOPEN if (!retval) retval = ERR_FOPEN; + } #else