aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-09-15 16:47:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-10-27 15:49:45 +0200
commit2f2131fa0e65553fa1313bee2b8e0f35b43af3d9 (patch)
tree67a18244ede9a2a688a7106bf3aafabfbad4afb3
parentdc424654f198fa6dff7f08c8907d8c3f589a4e10 (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 81204bd..b96dfeb 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
@@ -1382,7 +1387,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 ();
@@ -1453,7 +1459,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);
@@ -1462,7 +1469,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 "
@@ -1561,7 +1568,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 ();