aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-09-15 16:47:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-09-15 16:47:48 +0200
commitf46331d6bcceecc55915c4e940147d6135611d33 (patch)
tree79db297e1bb0b469b894b51cf12d6df394aa744e
parentc8a5acd33a9a7c1b28818c5f916f02e0da86960a (diff)
Adjust TFTP parameters to try to get rid of flaky uploads
-rw-r--r--bbot/worker/worker.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index f5d9cb9..dd941ad 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -49,8 +49,13 @@ namespace bbot
dir_path env_dir;
- const size_t tftp_timeout (10); // 10 seconds.
- const size_t tftp_retries (3); // Task request retries (see startup()).
+ // Note that upload can be quite large and take a while to upload under high
+ // load.
+ //
+ const size_t tftp_blksize (1024); // Between 512 (default) and 65464.
+ const size_t tftp_put_timeout (100); // 100 seconds.
+ const size_t tftp_get_timeout (10); // 10 seconds.
+ const size_t tftp_get_retries (3); // Task request retries (see startup()).
}
static dir_path
@@ -1393,7 +1398,8 @@ build (size_t argc, const char* argv[])
nullfd,
curl::put,
url,
- "--max-time", tftp_timeout);
+ "--tftp-blksize", tftp_blksize,
+ "--max-time", tftp_put_timeout);
serialize_manifest (rm, c.out, url, "result");
c.out.close ();
@@ -1464,7 +1470,8 @@ startup ()
mf,
curl::get,
url,
- "--max-time", tftp_timeout);
+ "--tftp-blksize", tftp_blksize,
+ "--max-time", tftp_get_timeout);
if (!c.wait ())
throw_generic_error (EIO);
@@ -1473,7 +1480,7 @@ startup ()
}
catch (const system_error& e)
{
- bool bail (retry > tftp_retries);
+ bool bail (retry > tftp_get_retries);
diag_record dr (bail ? error : warn);
dr << "unable to download task manifest from " << url << " on "
@@ -1572,7 +1579,8 @@ startup ()
nullfd,
curl::put,
url,
- "--max-time", tftp_timeout);
+ "--tftp-blksize", tftp_blksize,
+ "--max-time", tftp_put_timeout);
serialize_manifest (rm, c.out, url, "result");
c.out.close ();