Skip to content
2 changes: 0 additions & 2 deletions app/buck2_execute/src/re/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,7 @@ fn re_platform(x: &RE::Platform) -> remote_execution::TPlatform {
properties: x.properties.map(|x| remote_execution::TProperty {
name: x.name.clone(),
value: x.value.clone(),
..Default::default()
}),
..Default::default()
}
}

Expand Down
18 changes: 18 additions & 0 deletions app/buck2_re_configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use buck2_core::rollout_percentage::RolloutPercentage;

static BUCK2_RE_CLIENT_CFG_SECTION: &str = "buck2_re_client";

const DEFAULT_MAX_RETRIES: usize = 5;

/// We put functions here that both things need to implement for code that isn't gated behind a
/// fbcode_build or not(fbcode_build)
pub trait RemoteExecutionStaticMetadataImpl: Sized {
Expand Down Expand Up @@ -468,6 +470,10 @@ pub struct Buck2OssReConfiguration {
pub grpc_keepalive_while_idle: Option<bool>,
/// Maximum number of concurrent execution requests.
pub execution_concurrency_limit: Option<usize>,
/// Maximum retries for RPC requests. Defaults to 5.
pub max_retries: usize,
/// Timeout for RPC requests in seconds. Defaults to 60s.
pub grpc_timeout: u64,
}

#[derive(Clone, Debug, Default, Allocative)]
Expand Down Expand Up @@ -589,6 +595,18 @@ impl Buck2OssReConfiguration {
section: BUCK2_RE_CLIENT_CFG_SECTION,
property: "execution_concurrency_limit",
})?,
max_retries: legacy_config
.parse(BuckconfigKeyRef {
section: BUCK2_RE_CLIENT_CFG_SECTION,
property: "max_retries",
})?
.unwrap_or(DEFAULT_MAX_RETRIES),
grpc_timeout: legacy_config
.parse(BuckconfigKeyRef {
section: BUCK2_RE_CLIENT_CFG_SECTION,
property: "grpc_timeout",
})?
.unwrap_or(60),
})
}
}
Expand Down
Loading
Loading