From 44992df53fd47e494453f247a358d9a2231dec73 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Oct 2020 16:47:14 +0200 Subject: Fix few bugs in worker result upload logic --- bbot/worker/worker.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'bbot/worker/worker.cxx') 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. // -- cgit v1.1