summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/launch.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-17 15:44:54 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-18 15:51:28 +0200
commit88c792e051aea57823423bd91dfb4c439a7b52a8 (patch)
treedc524de7d5e1b6cd727ad24cbaaddbca6377b965 /src/other_tools/just_mr/launch.cpp
parent8744b30b9612354b42474b2a1fb323fce5d182c1 (diff)
downloadjustbuild-88c792e051aea57823423bd91dfb4c439a7b52a8.tar.gz
just-mr: support retry for temporary grpc failures
... using the same mechanism that just uses. As just-mr now also does quite some grpc calls, e.g., fetching distribution files from the remote-execution endpoint and negociating roots with the serve endpoint, it may now also be affected by a bad network or a service temporarily be unavailable.
Diffstat (limited to 'src/other_tools/just_mr/launch.cpp')
-rw-r--r--src/other_tools/just_mr/launch.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp
index 1236d9f4..693d8808 100644
--- a/src/other_tools/just_mr/launch.cpp
+++ b/src/other_tools/just_mr/launch.cpp
@@ -35,6 +35,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file,
MultiRepoJustSubCmdsArguments const& just_cmd_args,
MultiRepoLogArguments const& log_args,
MultiRepoRemoteAuthArguments const& auth_args,
+ RetryArguments const& retry_args,
ForwardOnlyArguments const& launch_fwd,
bool forward_build_root,
std::string multi_repo_tool_name) -> int {
@@ -185,6 +186,19 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file,
cmd.emplace_back("--tls-client-key");
cmd.emplace_back(auth_args.tls_client_key->string());
}
+ if (retry_args.max_attempts) {
+ cmd.emplace_back("--max-attempts");
+ cmd.emplace_back(std::to_string(*retry_args.max_attempts));
+ }
+ if (retry_args.initial_backoff_seconds) {
+ cmd.emplace_back("--initial-backoff-seconds");
+ cmd.emplace_back(
+ std::to_string(*retry_args.initial_backoff_seconds));
+ }
+ if (retry_args.max_backoff_seconds) {
+ cmd.emplace_back("--max-backoff-seconds");
+ cmd.emplace_back(std::to_string(*retry_args.max_backoff_seconds));
+ }
}
if (supports_dispatch and just_cmd_args.endpoint_configuration) {
cmd.emplace_back("--endpoint-configuration");