diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-05-19 11:39:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-05-19 11:39:26 +0200 |
commit | 811feb240cf02ed264003c72cf0aa2e31edf7c78 (patch) | |
tree | 8a46b2fdc9a7aea5e9796a0a766e47d197526837 | |
parent | 57ed3ca445f4f6689e25f790ff9be62912b386c9 (diff) |
Make TFTP upload even more robust
-rw-r--r-- | bbot/agent.cxx | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/bbot/agent.cxx b/bbot/agent.cxx index 3c7b248..f7bccde 100644 --- a/bbot/agent.cxx +++ b/bbot/agent.cxx @@ -212,7 +212,7 @@ bootstrap_machine (const dir_path& md, // manifest file. // for (to = bootstrap_to; - to != 0 && !file_exists (mf); + to != 0 && (!file_exists (mf) || file_empty (mf)); tftpd.serve (to)) ; if (to == 0) @@ -221,7 +221,7 @@ bootstrap_machine (const dir_path& md, l3 ([&]{trace << "completed bootstrap in " << bootstrap_to - to << "s";}); // The file may have been created but not yet (completely) uploaded. - // So we wait for one second without any TFTP activity. + // So we wait for a one second window without any TFTP activity. // while (tftpd.serve ((to = 1))) ; @@ -513,9 +513,14 @@ try // if (int i = compare_bbot (bmm->bootstrap)) { - assert (i > 0); - l3 ([&]{trace << "ignoring " << tp << ": old bbot";}); - break; + if (i > 0) + { + l3 ([&]{trace << "ignoring " << tp << ": old bbot";}); + break; + } + else + warn << "bootstrapped " << tp << " bbot worker is older " + << "than agent; assuming test setup"; } } else @@ -686,7 +691,13 @@ try // So on our side we serve TFTP requests while checking for the // manifest file. // - for (to = build_to; to != 0 && !file_exists (rf); tftpd.serve (to)) ; + // There are seem to be some "anomalies" in the Windows network stack + // in that we get an empty file and then the upload process gets stuck + // for no apparent reason. + // + for (to = build_to; + to != 0 && (!file_exists (rf) || file_empty (rf)); + tftpd.serve (to)) ; if (to == 0) return soft_fail ("build timeout"); @@ -694,7 +705,7 @@ try l3 ([&]{trace << "completed build in " << build_to - to << "s";}); // The file may have been created but not yet (completely) uploaded. - // So we wait for one second without any TFTP activity. + // So we wait for a one second window without any TFTP activity. // while (tftpd.serve ((to = 1))) ; |