Skip to content

Commit 2a2ca64

Browse files
Prevent retry loop large uploads (#2195)
1 parent d926c47 commit 2a2ca64

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

nativelink-config/src/stores.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,10 +1156,16 @@ pub struct GrpcSpec {
11561156
pub connections_per_endpoint: usize,
11571157

11581158
/// Maximum time (seconds) allowed for a single RPC request (e.g. a
1159-
/// ByteStream.Write call) before it is cancelled. This prevents
1160-
/// individual RPCs from hanging forever on dead connections.
1159+
/// ByteStream.Write call) before it is cancelled.
11611160
///
1162-
/// Default: 120 (seconds)
1161+
/// A value of 0 (the default) disables the per-RPC timeout. Dead
1162+
/// connections are still detected by the HTTP/2 and TCP keepalive
1163+
/// mechanisms configured on each endpoint.
1164+
///
1165+
/// For large uploads (multi-GB), either leave this at 0 or set it
1166+
/// large enough to accommodate the full transfer time.
1167+
///
1168+
/// Default: 0 (disabled)
11631169
#[serde(default, deserialize_with = "convert_duration_with_shellexpand")]
11641170
pub rpc_timeout_s: u64,
11651171
}

nativelink-store/src/grpc_store.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ impl GrpcStore {
9090
endpoints.push(endpoint);
9191
}
9292

93-
let rpc_timeout = if spec.rpc_timeout_s > 0 {
94-
Duration::from_secs(spec.rpc_timeout_s)
95-
} else {
96-
Duration::from_secs(120)
97-
};
93+
let rpc_timeout = Duration::from_secs(spec.rpc_timeout_s);
9894

9995
Ok(Arc::new(Self {
10096
instance_name: spec.instance_name.clone(),

0 commit comments

Comments
 (0)