Problem
The timeout_with_retries function in crates/comenqd/src/daemon.rs contains unreachable code. The final return statement after the loop is never executed because all match arms within the loop already return.
Location
Issue
The function ends with:
}
Err(format!("{} exhausted all retry attempts", operation_name))
}
This final Err(...) statement is unreachable because:
- The loop iterates exactly 3 times (based on
PROGRESSIVE_RETRY_PERCENTS = [50, 100, 150])
- On the final iteration, the timeout case always returns:
Err(_) => {
if attempt_num < timeouts.len() { // false on final attempt
// retry logic
} else {
// This branch ALWAYS executes on the final attempt
return Err(format!("{} timed out after all retry attempts", operation_name));
}
}
Solution
Remove the final two lines so the function ends immediately after the loop:
Context
Problem
The
timeout_with_retriesfunction incrates/comenqd/src/daemon.rscontains unreachable code. The final return statement after the loop is never executed because all match arms within the loop already return.Location
crates/comenqd/src/daemon.rstimeout_with_retries(lines ~226-228 in PR Add adaptive test timeout utilities #74)Issue
The function ends with:
This final
Err(...)statement is unreachable because:PROGRESSIVE_RETRY_PERCENTS = [50, 100, 150])Solution
Remove the final two lines so the function ends immediately after the loop:
Context