aboutsummaryrefslogtreecommitdiff
path: root/bbot/worker/worker.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-09-09 08:43:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-09-09 11:03:59 +0200
commit99221a546b10545a7ed7af53044b088217e150eb (patch)
treec7ba826af1a1b7249bbe3d41a15a92e81924646c /bbot/worker/worker.cxx
parent35ff21c72e65d1e01678d67c7dd985e2959d4ebf (diff)
Compress result manifest uploaded by worker
These files contain build logs and can be quite large. And large files sometimes trip up upload on Windows.
Diffstat (limited to 'bbot/worker/worker.cxx')
-rw-r--r--bbot/worker/worker.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index 1f5c946..eb7f50b 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -547,9 +547,9 @@ run_b (step_id step,
verbosity, buildspec, forward<A> (a)...);
}
-// Upload manifest to the specified TFTP URL with curl. Issue diagnostics and
-// throw failed on invalid manifest or process management errors and throw
-// io_error for input/output errors or non-zero curl exit.
+// Upload compressed manifest to the specified TFTP URL with curl. Issue
+// diagnostics and throw failed on invalid manifest or process management
+// errors and throw io_error for input/output errors or non-zero curl exit.
//
template <typename T>
static void
@@ -564,9 +564,11 @@ upload_manifest (tracer& trace,
// broken pipe error on the client and partial/truncated upload on the
// server. This happens quite regularly on older Linux distributions
// (e.g., Debian 8, Ubuntu 16.04) but also sometimes on Windows. On the
- // other hand, uploading from a file appears to work reliably.
+ // other hand, uploading from a file appears to work reliably (we still
+ // get an odd error on Windows from time to time with larger uploads).
//
#if 0
+ // Note: need to add compression support if re-enable this.
tftp_curl c (trace,
path ("-"),
nullfd,
@@ -582,10 +584,12 @@ upload_manifest (tracer& trace,
auto_rmfile tmp;
try
{
- tmp = auto_rmfile (path::temp_path (what + "-manifest"));
+ tmp = auto_rmfile (path::temp_path (what + "-manifest.lz4"));
ofdstream ofs (tmp.path);
- manifest_serializer s (ofs, tmp.path.string ());
+ olz4stream ozs (ofs, 9, 5 /* 256KB */, nullopt /* content_size */);
+ manifest_serializer s (ozs, tmp.path.string ());
m.serialize (s);
+ ozs.close ();
ofs.close ();
}
catch (const io_error& e) // In case not derived from system_error.
@@ -2119,7 +2123,7 @@ build (size_t argc, const char* argv[])
// Upload the result.
//
- const string url ("tftp://" + ops.tftp_host () + "/result.manifest");
+ const string url ("tftp://" + ops.tftp_host () + "/result.manifest.lz4");
try
{
@@ -2297,7 +2301,7 @@ startup ()
}
catch (const failed&)
{
- const string url ("tftp://" + ops.tftp_host () + "/result.manifest");
+ const string url ("tftp://" + ops.tftp_host () + "/result.manifest.lz4");
// If we failed before being able to parse the task manifest, use the
// "unknown" values for the package name and version.