Repository navigation
fix(agent): run nfsdcld so nfsd skips the NFSv4 grace period - #762
Merged
Merged
Conversation
The kernel refuses /proc/fs/nfsd/v4_end_grace without a client tracker, so every boot ran the 10 s grace period and the host's first open under ~/ArcBox stalled 6-12 s on NFS4ERR_GRACE retries. Mount rpc_pipefs and start nfsdcld, with its database on the /var tmpfs, before nfsd starts. Wait for nfsdcld's pipe watch first: its fresh-database upgrade reads nfsv4recoverydir, which blocks on the nfsd_mutex the threads write holds while nfsd waits for the tracker. With the tracker up nfsd skips grace. A rootfs without nfsdcld keeps the old behavior, and a failed v4_end_grace write now logs a warning.
Boot assets 0.8.12 ship nfsdcld in the rootfs, so the guest agent's client tracker starts and nfsd skips the NFSv4 grace period. The kernel is unchanged from 0.8.11 (v0.0.25).
[Medium impact] This PR appears safe to merge; no actionable issues were found. SummaryStarts
AprilNEA explicitly describes the full grace period on older rootfs images as an intentional fallback.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The guest's NFSv4 grace period ran for the full 10 s on every boot:
end_grace_early()got EBUSY because nfsd had no client tracker, and the macOS client retries a refused OPEN every 2 s. The first open under~/ArcBoxafter boot waited 6–12 s (e2enfs_export8/10/12 s).rpc_pipefsand startsnfsdcldon tmpfs before nfsd threads start, so nfsd logs "no clients to reclaim, skipping NFSv4 grace period". Without/sbin/nfsdcldin the rootfs it warns and keeps the old path.nfsdcld(boot-assets 7eff507).Measured on HV and VZ against the published 0.8.12: first open returns at once; e2e boot_assets
nfs_export0.0015 s (HV) and 0.0025 s (VZ).Note
Medium Risk
Changes guest NFS bring-up ordering and boot asset pin; mis-timed nfsdcld readiness could still leave grace stalls, but behavior degrades to the prior path with warnings.
Overview
Fixes 6–12 s stalls on the first NFS open under
~/ArcBoxafter boot, caused by the full NFSv4 grace period when the kernel refused earlyv4_end_gracewithout a client tracker.The guest agent now mounts
rpc_pipefs, startsnfsdcld(tmpfs state) before nfsd threads, and waits until nfsdcld holds an inotify fd so startup ordering does not race withnfsd_mutex. Rootfs without/sbin/nfsdcldstill works but logs a warning and keeps the old grace behavior.spawn_supervisedfactors shared daemon spawning forrpc.mountdand nfsdcld;end_grace_earlyskips when grace already ended and warns on failure instead of debug-only.Boot assets pin moves to 0.8.12, which ships nfsdcld. Docs add a log entry with measurements; e2e
boot_assetscomments reflect nfsdcld vs legacy grace timing.Reviewed by Cursor Bugbot for commit 0903eb5. Bugbot is set up for automated code reviews on this repo. Configure here.