aboutsummaryrefslogtreecommitdiff
path: root/bbot/worker/worker.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-10-01 16:47:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-10-27 15:49:45 +0200
commit44992df53fd47e494453f247a358d9a2231dec73 (patch)
treeb7cba4e56a38cc1cf7cd5a8dce9043b4220b856f /bbot/worker/worker.cxx
parentc87b1e4b8b474cdbdd2122006fdaa2a4866e9291 (diff)
Fix few bugs in worker result upload logic
Diffstat (limited to 'bbot/worker/worker.cxx')
-rw-r--r--bbot/worker/worker.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index e07df30..d7027f8 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -1398,7 +1398,11 @@ build (size_t argc, const char* argv[])
}
catch (const system_error& e)
{
- fail << "unable to upload result manifest to " << url << ": " << e;
+ // We use exit code 3 to signal an unsuccessful attempt to upload the
+ // result manifest. See startup() for details.
+ //
+ error << "unable to upload result manifest to " << url << ": " << e;
+ return 3;
}
// We use exit code 2 to signal abnormal termination but where we managed
@@ -1541,9 +1545,14 @@ startup ()
// Exit code 2 signals abnormal termination but where the worker uploaded
// the result itself.
//
+ // Exit code 3 signals an unsuccessful attempt by the worker to upload the
+ // result manifest. There is no reason to retry (most likely there is
+ // nobody listening on the other end anymore).
+ //
string tg (tm.target.string ());
switch (run_exit (trace, pp, tg, argv0.effect_string (), os))
{
+ case 3:
case 2: return 1;
case 0: return 0;
default: fail << "process " << pp << " exited with non-zero code" << endf;
@@ -1551,6 +1560,8 @@ startup ()
}
catch (const failed&)
{
+ const string url ("tftp://" + ops.tftp_host () + "/result.manifest");
+
// If we failed before being able to parse the task manifest, use the
// "unknown" values for the package name and version.
//