Skip to content

Require an i_version NFS export and log preparation errors - #935

Merged
SaladDay merged 1 commit into
mainfrom
codex/require-iversion-nfs-export
Nov 6, 2026
Merged

SaladDay merged 1 commit into
mainfrom
codex/require-iversion-nfs-export

Conversation

@SaladDay

@SaladDay SaladDay commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Reusing a standalone Environment on microsandbox failed about 40% of the time with Runtime preparation failed before execution.

Cause: the workspace export sat on ext4 without iversion, so nfsd used coarse ctime as the change attribute. A client that lists a directory and then creates a file in the same tick keeps serving the old listing. Codex lists thread-writer-locks/ before creating its lock, so the daemon's RemoveAll of the earlier Session's state missed the lock file and failed with ENOTEMPTY.

  • docs/getting-started/workspace-storage.md (and zh): the export must be on XFS or ext4 mounted with iversion.
  • The daemon's executor native_prepare log line now carries the error.

Verification on a test cluster (kernel 5.15, NFSv4.2):

  • Listing after create in the same directory, over the NFS mount: missed the new file 41/50 without iversion, 0/50 after mount -o remount,iversion.
  • The same sequence through the sandbox's virtiofs mount: 34/50 missed; local tmpfs 0/50.
  • Codex-shaped lock sequence then rmtree: fails only when the directory was listed before the lock was created (7/20 and 9/20 with and without flock, 0/20 without the listing).
  • go test ./internal/dispatch/, check-translations.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

On an ext4 export without iversion, nfsd derives the change attribute from
coarse ctime. A client that lists a directory and then creates a file in the
same tick keeps serving the old listing, so a later RemoveAll misses the file
and fails with ENOTEMPTY. Codex scans its thread-writer lock directory before
it creates the lock, so reusing an Environment failed Runtime preparation.

Document the export filesystem requirement and log the preparation error.
@SaladDay
SaladDay merged commit 673085b into main Nov 6, 2026
21 checks passed
@SaladDay
SaladDay deleted the codex/require-iversion-nfs-export branch November 6, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant