aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-10-01 16:47:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-10-01 16:47:14 +0200
commit346e7d9d4de6b37af7ec156db4cda892ab804634 (patch)
treead3d3b0078a8320eb80a73d5e8da6219bc787a60
parentba7e7ed3cf2a793633f6cf74128ff1c60d68cbdb (diff)
Fix few bugs in worker result upload logic
-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 686bab9..12e5fde 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -1445,7 +1445,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
@@ -1588,9 +1592,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;
@@ -1598,6 +1607,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.
//