diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-04-17 15:44:54 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-04-18 15:51:28 +0200 |
commit | 88c792e051aea57823423bd91dfb4c439a7b52a8 (patch) | |
tree | dc524de7d5e1b6cd727ad24cbaaddbca6377b965 /src/other_tools/just_mr/launch.cpp | |
parent | 8744b30b9612354b42474b2a1fb323fce5d182c1 (diff) | |
download | justbuild-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.cpp | 14 |
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"); |