From 88c792e051aea57823423bd91dfb4c439a7b52a8 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 17 Apr 2024 15:44:54 +0200 Subject: 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. --- src/other_tools/just_mr/launch.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/other_tools/just_mr/launch.cpp') 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 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 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"); -- cgit v1.2.3