Conversation
The 500ms sleep wasn't enough for large images or slow hosts. Replace with a poll loop that waits up to 30s for each FUSE mount to become accessible via read_dir before starting the container.
- Return error when mount not ready after 30s (was silently continuing) - Fix elapsed time calculation: (attempt - 1) * 500 instead of attempt * 500 - Ensures containers don't start with inaccessible mounts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🔍 Claude ReviewSEVERITY: low Findings[LOW] Unnecessary sleep on final timeout iteration - When the poll loop reaches its 60th iteration and the mount is still not ready, the code sleeps for 500ms (line 1712) before exiting the loop and returning an error (line 1715). This wastes 500ms before reporting the timeout. Consider adding a condition to skip the sleep when if !ready && attempt < 60 {
std::thread::sleep(std::time::Duration::from_millis(500));
}[LOW] Documentation mismatch - The comment on line 1696 and error message on line 1716 state "up to 30s" timeout, but the actual implementation waits up to 29.5s (59 sleeps × 500ms = 29,500ms). With
SummaryThe core improvement (replacing fixed 500ms sleep with proper polling + error handling) is excellent and addresses the race condition effectively. The issues found are minor optimizations and documentation consistency improvements. Review by Claude | Run |
🔧 Auto-Fix CreatedI found minor issues and created a fix PR: #261 The fix PR addresses:
Please review and merge the fix PR first, then this PR. |
Fix FUSE mount race: poll for readiness
Fix FUSE mount race: poll for readiness
Summary
Replace the fixed 500ms sleep for FUSE mount initialization with a proper poll loop. Waits up to 30s for each mount to become accessible via
read_dirbefore starting the container. Returns error if mount fails (previously silently continued with broken mounts).Problem
The entrypoint symlink was dangling when the container launched because the FUSE mount wasn't ready after only 500ms.
Test plan