Skip to content

Commit 8354cec

Browse files
committed
fix: increase NFS timeout from 1s to 5s to allow valid mounts to succeed
**Problem:** NFS mounts were failing with "Mount failed after 3 attempts" even for valid, working shares like nfs://192.168.1.224/var/nfs/shared/data. **Root Cause:** The timeo=10 (1 second RPC timeout) option added in commit 5ade992 was too aggressive. Valid NFS mounts on local networks can take >1 second due to: - Server load and disk I/O - NFS protocol handshake overhead - Network conditions **Solution:** Increased timeo from 10 (1s) to 50 (5s): - Allows valid mounts to succeed even with server load - Still provides reasonably fast failure (~20-25s total for non-existent shares) - Maintains fail-fast behavior with soft mount option **Impact:** - Valid shares: Now succeed within 5 seconds - Invalid shares: Fail in ~20-25 seconds (vs previous 150+ seconds before commit 5ade992) - Balanced approach between fast failure and mount success Files modified: - src/mount/drivers/nfs.rs: Changed timeo=10 to timeo=50 - tests/unit/mount_drivers_test.rs: Updated test assertion
1 parent 5ade992 commit 8354cec

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/mount/drivers/nfs.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl MountHandler for NfsHandler {
310310
fn get_default_options(&self) -> Vec<String> {
311311
vec![
312312
"nolock".to_string(), // No remote locking (avoids rpc.statd requirement)
313-
"timeo=10".to_string(), // RPC timeout: 1 second (10 * 0.1s)
313+
"timeo=50".to_string(), // RPC timeout: 5 seconds (50 * 0.1s)
314314
"retrans=2".to_string(), // Retransmission attempts before failing
315315
"soft".to_string(), // Fail fast instead of hanging indefinitely
316316
"_netdev".to_string(), // Proper network device handling

‎tests/unit/mount_drivers_test.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ fn test_nfs_default_options_include_timeouts() {
703703

704704
// Verify NFS timeout options are present for fast failure
705705
assert!(
706-
options.contains(&"timeo=10".to_string()),
707-
"Should include timeo=10 for 1-second RPC timeout"
706+
options.contains(&"timeo=50".to_string()),
707+
"Should include timeo=50 for 5-second RPC timeout"
708708
);
709709
assert!(
710710
options.contains(&"retrans=2".to_string()),

0 commit comments

Comments
 (0)